The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

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"
}
}