zeronil (4) [Avatar] Offline
#1
When I execute the command
npm test
in the project directory on OS X I get an error stating "sh: run-local-lambda: command not found".

The Node packages are installed and the following is my package.json file:

{
  "name": "serverless-architecture",
  "version": "1.0.0",
  "description": "Serverless Architectures on AWS",
  "main": "index.js",
  "scripts": {
    "test": "run-local-lambda --file index.js –-event tests/event.json"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "aws-sdk": "^2.3.19",
    "run-local-lambda": "^1.1.1"
  },
  "eslintConfig": {
    "env": {
      "browser": false,
      "node": true
    },
    "parserOptions": {
      "ecmaVersion": 6
    }
  }
}


Any idea what might be going wrong? Thanks!
513 (2) [Avatar] Offline
#2
Your package.json looks good.
Please ensure the run-local-lambda package is properly installed.


ls -la node_modules/.bin/

should give you the following:

run-local-lambda -> ../run-local-lambda/bin/run-local-lambda.js


HTH,


Serge
Rails4G (19) [Avatar] Offline
#3
Same error "run-local-lambda: command not found"

ls -la node_modules/.bin/

run-local-lambda -> ../run-local-lambda/bin/run-local-lambda.js


"name": "transcode-video",
"version": "1.0.0",
"description": "Transcode Video Function",
"main": "index.js",
"scripts": {
"test": "run?local?lambda ??file index.js –?event tests/event.json"
},
"dependencies": {
"aws-sdk": "latest"
},
"author": "",
"license": "BSD-2-Clause",
"devDependencies": {
"run-local-lambda": "^1.1.1"
}
}