I am new to javascript and I am having import issues.
I have installed the jquery.csv lib as npm i jquery.csv but then node is not able to import it. (this was the procedure described in https://github.com/typeiii/jquery-csv)
Here is the structure of my project:
lucapuggini#lucas-MBP js_utils % ls
index.js index.js~ node_modules package-lock.json package.json
lucapuggini#lucas-MBP js_utils % ls node_modules
jquery-csv
lucapuggini#lucas-MBP js_utils % cat index.js
var csv = require('./jquery.csv.js');
console.log("Start index.js")
lucapuggini#lucas-MBP js_utils % cat package-lock.json
{
"name": "js_utils",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"jquery-csv": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/jquery-csv/-/jquery-csv-1.0.11.tgz",
"integrity": "sha512-KDPc3wFLTFO68p/4IqsODZCjBp+y9axDa/pr36pDKrWk6yyHf8Nk1FqAGXvaUb6H7J1zJSYszABIFj0a40QXRA=="
}
}
}
lucapuggini#lucas-MBP js_utils % node index.js
node:internal/modules/cjs/loader:922
throw err;
^
Error: Cannot find module './jquery.csv.js'
Require stack:
- /Users/lucapuggini/ProgrammingProjects/padel/trunk/js_utils/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
at Function.Module._load (node:internal/modules/cjs/loader:763:27)
at Module.require (node:internal/modules/cjs/loader:991:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/lucapuggini/ProgrammingProjects/padel/trunk/js_utils/index.js:2:11)
at Module._compile (node:internal/modules/cjs/loader:1102:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/lucapuggini/ProgrammingProjects/padel/trunk/js_utils/index.js'
]
}
lucapuggini#lucas-MBP js_utils %
Why am I getting this error?
It seems their documentation is incorrect. You need to require the npm module like this:
const csv = require('jquery-csv');
Related
I am newbie on Jest and I have the following issue when I execute the command
npm test
I have the following files
functions.js
const functions = {
add: (num1,num2) => num1 + num2
};
module.exports = functions;
and the functions.test.js
const functions = require('./functions');
test(`Adds 2 + 2 to equal 4`, ()=>{
expect(functions.add(2,2)).toBe(4);
});
my package.json has the following context
{
"name": "jest-tutorial",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"jest": "^29.2.2"
}
}
I havent found a lot of resources on the internet regarding the error I just try to remove the dot (.) character from the node_modules/jest
and the output of the console (error) is below
> jest-tutorial#1.0.0 test
> jest
C:\Users\agiallelis\node_modules\jest-cli\build\run.js:129
if (error?.stack) {
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1054:16)
at Module._compile (internal/modules/cjs/loader.js:1102:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\agiallelis\node_modules\jest-cli\build\index.js:12:12)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
I am trying to create a cli tool to make a todo list. For some reason I can't figure out I'm unable to use either require or import when trying to import the Chalk package for highlighting terminal outputs
here is what I have for my index.js file
#! /usr/bin/env node
const { program } = require("commander");
const list = require("./commands/list.js");
program.command("list").description("List all the TODO tasks").action(list);
program.parse();
Here is my list.js file
#! /usr/bin/env node
const conf = new (require("conf"))();
const chalk = require("chalk");
function list() {
const todoList = conf.get("todo-list");
if (todoList && todoList.length) {
console.log(
chalk.blue.bold(
"Tasks in green are done. Tasks in yellow are still not done."
)
);
todoList.forEach((task, index) => {
if (task.done) {
console.log(chalk.greenBright(`${index}. ${task.text}`));
} else {
console.log(chalk.yellowBright(`${index}. ${task.text}`));
}
});
} else {
console.log(chalk.red.bold("You don't have any tasks yet."));
}
}
module.exports = list;
and my package.json file
{
"name": "near-clear-state",
"version": "1.0.0",
"description": "Tool to let NEAR users clear the state of their account ",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"type": "commonjs",
"author": "Dorian",
"license": "ISC",
"dependencies": {
"chalk": "^5.0.0",
"commander": "^8.3.0",
"conf": "^10.1.1",
"near-api-js": "^0.44.2"
},
"bin": {
"near-clear-state": "./index.js"
}
}
when I try running anything from this cli tool I'm making I get this error if I use require
➜ near-clear-state near-clear-state --help
/Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/commands/list.js:4
const chalk = require("chalk");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/node_modules/chalk/source/index.js from /Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/commands/list.js not supported.
Instead change the require of index.js in /Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/commands/list.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/commands/list.js:4:15)
at Object.<anonymous> (/Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/index.js:3:14) {
code: 'ERR_REQUIRE_ESM'
}
Or this error when i use import
/Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/commands/list.js:3
import { Chalk } from "chalk";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1026:15)
at Module._compile (node:internal/modules/cjs/loader:1061:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/doriankinoocrutcher/Documents/NEAR/Developer/near-clear-state/index.js:3:14)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
Node.js v17.4.0
Please help me
Use the import syntax, and add "type": "module" into your package.json to allow for ES6 imports.
I solved this during the writing of the question and have provided my answer below since it was a bit tricky to work out. I am happy to hear any better or alternative answers.
I have an Angular OpenLayers 6 geomapping app. Being Angular I use Typescript and it transpiles and runs fine. And also being Angular it uses ng test to do the testing. All tests run fine.
However I use mocha + chai for testing in the IDE (IntelliJ) since I don't require UI testing for the mathematical work I'm currently performing (ng test runs the UI tests if and when I need that. But in the IDE I select the tests to run). Testing this way worked fine until I added a new test that creates a new instance of a class that imports GeoJSON:
import GeoJSON from 'ol/format/GeoJSON';
That test fails (in mocha) with:
/home/smx9b6/dev/ng-eow/node_modules/ol/format/GeoJSON.js:17
import { assert } from '../asserts.js';
^
SyntaxError: Unexpected token {
Looking at the GeoJSON.js file it seems to have UMD module format (i think this is UMD):
/**
* #module ol/format/GeoJSON
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { assert } from '../asserts.js';
import Feature from '../Feature.js';
var GeoJSON = /** #class */ (function (_super) {
__extends(GeoJSON, _super);
/**
* #param {Options=} opt_options Options.
*/
function GeoJSON(opt_options) {
...
}
GeoJSON.prototype.writeGeometryObject = function (geometry, opt_options) {
return writeGeometry(geometry, this.adaptOptions(opt_options));
};
return GeoJSON;
}(JSONFeature));
And others, such as turf.js use the ES6 module format. eg. line-to-polygon:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var bbox_1 = require("#turf/bbox");
var invariant_1 = require("#turf/invariant");
var helpers_1 = require("#turf/helpers");
...
function lineToPolygon(lines, options) {
if (options === void 0) { options = {}; }
...
}
...
exports.default = lineToPolygon;
Mocha can't deal with this but Angular can - I don't know why. I run mocha with (as reported by IntelliJ when running the test - full paths removed):
node node_modules/mocha/bin/_mocha --require ts-node/register --ui bdd --reporter mochaIntellijReporter.js
src/app/geometry-ops.spec.ts --grep "^geometry-ops centroid "
I have commonjs set as the module type:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [],
"resolveJsonModule": true,
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
...
}
The error in full is:
/home/smx9b6/dev/ng-eow/node_modules/ol/format/GeoJSON.js:17
import { assert } from '../asserts.js';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/smx9b6/dev/ng-eow/src/app/layers-geometries.ts:4:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/smx9b6/dev/ng-eow/src/app/geometry-ops.spec.ts:13:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at /home/smx9b6/dev/ng-eow/node_modules/mocha/lib/mocha.js:334:36
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/mocha.js:331:14)
at Mocha.run (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/mocha.js:809:10)
at Object.exports.singleRun (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/run-helpers.js:108:16)
at exports.runMocha (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/run-helpers.js:142:13)
at Object.exports.handler.argv [as handler] (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/run.js:292:3)
at Object.runCommand (/home/smx9b6/dev/ng-eow/node_modules/mocha/node_modules/yargs/lib/command.js:242:26)
at Object.parseArgs [as _parseArgs] (/home/smx9b6/dev/ng-eow/node_modules/mocha/node_modules/yargs/yargs.js:1087:28)
at Object.parse (/home/smx9b6/dev/ng-eow/node_modules/mocha/node_modules/yargs/yargs.js:566:25)
at Object.exports.main (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/cli.js:68:6)
at Object.<anonymous> (/home/smx9b6/dev/ng-eow/node_modules/mocha/bin/_mocha:10:23)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
I worked out and provide an answer below. However I would still like to hear any feedback on this. Such as should OpenLayers change their module format? (I'm still getting my head around all the different module formats).
The answer is to add --require esm --require jsdom-global/register to the node / mocha call.
The esm is to specify ES6 as the module format and jsdom-global is to define the DOM in non-browser environments (specifically to define document).
The full command is:
node node_modules/mocha/bin/_mocha --ui bdd \
--require ts-node/register \
--require esm \
--require jsdom-global/register \
--reporter landing \
src/app/geometry-ops.spec.ts --grep "^geometry-ops centroid "
(I added spaces in the command since it irks me when I have to scroll right to see such things).
I am happy to hear any better or alternative answers.
I'm trying to use o.spec to test mycomponent but failed.
The error message of "dart test" is:
tests/MyComponent.js:1
(function (exports, require, module, __filename, __dirname) { import MyComponent from "./src/mycomponent"
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Glob.<anonymous> (node_modules/mithril/ospec/bin/ospec:37:37)
error Command failed with exit code 1.
setup by npm or yarn:
yarn add mithril#next webpack webpack-cli
edit package.json:
{
...
"name": "my-project",
"scripts": {
"start": "webpack src/index.js --output bin/app.js -d --watch",
"build": "webpack src/index.js --output bin/app.js -p",
"test": "ospec"
}
}
index.html:
<!DOCTYPE html>
<body>
<script src="bin/app.js"></script>
</body>
src/mycomponent.js:
//var m = require("mithril")
import m from "mithril"
//module.exports = {
export default {
view: function(vnode) {
return m("div",
m("p", "Hello World")
)
}
}
src/index.js:
import m from "mithril"
import MyComponent from "./mycomponent"
//var m = require("mithril")
//var MyComponent = require("./mycomponent")
m.mount(document.body, MyComponent)
tests/MyComponent.js
import MyComponent from "./src/mycomponent"
//var MyComponent = require("./src/mycomponent")
o.spec("MyComponent", function() {
o("returns a div", function() {
var vnode = MyComponent.view()
o(vnode.tag).equals("div")
o(vnode.children.length).equals(1)
o(vnode.children[0].tag).equals("p")
o(vnode.children[0].children).equals("Hello world")
})
})
You need to mock the environment using
global.window = require("mithril/test-utils/browserMock.js")();
global.document = window.document;
in your tests.
Check more at https://mithril.js.org/testing.html
I am using the serverless framework to develop lambda functions in the aws cloud. Currently, I am running into an issue when including a library that I made. It seems the recommended way to do this is to either:
1) npm install <path/to/your/lib>
2) npm link and related commands
In the first situation, when using npm install ../libs, and include the module using const Libs = require('libs') , the package appears to install correctly (it is listed in the package.json). However, on uploading the service to aws or using sls invoke local -f my-func the following error is thrown:
{ Error: Cannot find module 'libs'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/Documents/GitHub/serverless-cloud-functions/dynamodb-stream-handlers/.webpack/service/service-provider-users-archive-stream-handler.js:419:18)
at __webpack_require__ (/Users/Documents/GitHub/serverless-cloud-functions/dynamodb-stream-handlers/.webpack/service/service-provider-users-archive-stream-handler.js:20:30)
at Object.<anonymous> (/Users/Documents/GitHub/serverless-cloud-functions/dynamodb-stream-handlers/.webpack/service/service-provider-users-archive-stream-handler.js:376:16)
at __webpack_require__ (/Users/Documents/GitHub/serverless-cloud-functions/dynamodb-stream-handlers/.webpack/service/service-provider-users-archive-stream-handler.js:20:30)
at Object.defineProperty.value (/Users/Documents/GitHub/serverless-cloud-functions/dynamodb-stream-handlers/.webpack/service/service-provider-users-archive-stream-handler.js:63:18)
at Object.<anonymous> (/Users/Documents/GitHub/serverless-cloud-functions/dynamodb-stream-handlers/.webpack/service/service-provider-users-archive-stream-handler.js:66:10)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at AwsInvokeLocal.invokeLocalNodeJs (/usr/local/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:258:33)
at AwsInvokeLocal.invokeLocal (/usr/local/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:125:19)
at AwsInvokeLocal.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:773:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate [as _immediateCallback] (timers.js:711:5) code: 'MODULE_NOT_FOUND' }
Using npm link gives similar results as well. I have a hunch that the issue has to do with the fact that I'm using babel and webpack, but I'm not sure.
Here is the contents of my webpack.config.js file:
const slsw = require("serverless-webpack");
const nodeExternals = require("webpack-node-externals");
module.exports = {
entry: slsw.lib.entries,
target: "node",
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
include: __dirname,
exclude: /node_modules/
}
]
},
};
Including the individual clients, instead of the overall lib seems to have solved the above error, but now I am faced with a new error.
Here is the serverless.yml file:
service: instant-response-api
plugins:
- serverless-webpack
- serverless-domain-manager
- serverless-plugin-aws-alerts
custom:
alerts:
topics:
alarm: ${file(./env.yml):${opt:stage}.ADMIN_SNS_TOPIC_ARN}
alarms:
- functionErrors
webpackIncludeModules: true
customDomain:
domainName: ${file(./env.yml):${opt:stage}.DOMAIN_NAME}
basepath: ''
stage: ${opt:stage}
createdRoute53Record: true
provider:
name: aws
runtime: nodejs6.10
region: us-west-2
stage: ${opt:stage}
environment:
${file(./env.yml):${opt:stage}}
iamRoleStatements:
- Effect: "Allow"
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:DescribeTable
Resource: "arn:aws:dynamodb:us-west-2:*:*"
- Effect: "Allow"
Action:
- sns:Publish
- sns:CreateTopic
Resource: "arn:aws:sns:*:*:*"
functions:
create-service-provider-number:
handler: create-service-provider-number.main
memorySize: 3008
timeout: 30
logRetentionInDays: 30
events:
- http:
path: create-service-provider-number/{serviceProviderId}
method: post
cors: true
alarms:
- functionErrors
service-provider-sms-handler:
handler: service-provider-sms-handler.main
memorySize: 3008
timeout: 30
logRetentionInDays: 30
events:
- http:
path: service-provider-sms-handler/{serviceProviderId}
method: post
cors: true
alarms:
- functionErrors
end-user-voice-handler:
handler: end-user-voice-handler.main
memorySize: 3008
timeout: 30
logRetentionInDays: 30
events:
- http:
path: end-user-voice-handler/{userId}/{propertyId}
method: post
cors: true
alarms:
- functionErrors
end-user-sms-handler:
handler: end-user-sms-handler.main
memorySize: 3008
timeout: 30
logRetentionInDays: 30
events:
- http:
path: end-user-sms-handler/{userId}/{propertyId}
method: post
cors: true
alarms:
- functionErrors
And here is package.json:
{
"name": "instant-response-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"aws-sdk": "^2.177.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-3": "^6.24.1",,
"jest": "^22.4.2",
"jest-cli": "^22.1.4",,
"serverless-domain-manager": "^2.1.0",
"serverless-plugin-aws-alerts": "^1.2.4",
"serverless-webpack": "^4.2.0",
"webpack": "^3.10.0",
"webpack-node-externals": "^1.6.0"
},
"dependencies": {
"#google/maps": "^0.4.5",
"babel-runtime": "^6.26.0",
"query-string": "^5.0.1",
"twilioClient": "file:../libs/twilioClient",
"dynamodbClient": "file:../libs/dynamodbClient",
"snsClient": "file:../libs/snsClient"
}
}
My new error:
START RequestId: a9962b1d-21dd-11e8-bc1e-35d1e2dcfd8e Version: $LATEST
Syntax error in module 'service-provider-sms-handler': SyntaxError
async sendSms({to, from, msg}) {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
END RequestId: a9962b1d-21dd-11e8-bc1e-35d1e2dcfd8e
REPORT RequestId: a9962b1d-21dd-11e8-bc1e-35d1e2dcfd8e Duration: 5.62 ms Billed Duration: 100 ms Memory Size: 3008 MB Max Memory Used: 22 MB