AWS install : Cannot find module './lib/red.js'

I have followed that guide to install an instance of nodered on AWS: Running on Amazon Web Services : Node-RED
I actually deployed with a pipeline, where source is a github repo with just a package.json, a buildspec and a setting file.
build and deploy happen successfully, but whe the app starts I get the below log.

Any idea what is wrong?

May 21 17:32:18 ip-172-31-32-75 web: > Node-red-dev@1.0.0 start /var/app/current
May 21 17:32:18 ip-172-31-32-75 web: > node-red -s ./settings.js
May 21 17:32:18 ip-172-31-32-75 web: internal/modules/cjs/loader.js:775
May 21 17:32:18 ip-172-31-32-75 web: throw err;
May 21 17:32:18 ip-172-31-32-75 web: ^
May 21 17:32:18 ip-172-31-32-75 web: Error: Cannot find module './lib/red.js'
May 21 17:32:18 ip-172-31-32-75 web: Require stack:
May 21 17:32:18 ip-172-31-32-75 web: - /var/app/current/node_modules/.bin/node-red
May 21 17:32:18 ip-172-31-32-75 web: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
May 21 17:32:18 ip-172-31-32-75 web: at Function.Module._load (internal/modules/cjs/loader.js:677:27)
May 21 17:32:18 ip-172-31-32-75 web: at Module.require (internal/modules/cjs/loader.js:830:19)
May 21 17:32:18 ip-172-31-32-75 web: at require (internal/modules/cjs/helpers.js:68:18)
May 21 17:32:18 ip-172-31-32-75 web: at Object.<anonymous> (/var/app/current/node_modules/.bin/node-red:39:11)
May 21 17:32:18 ip-172-31-32-75 web: at Module._compile (internal/modules/cjs/loader.js:936:30)
May 21 17:32:18 ip-172-31-32-75 web: at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
May 21 17:32:18 ip-172-31-32-75 web: at Module.load (internal/modules/cjs/loader.js:790:32)
May 21 17:32:18 ip-172-31-32-75 web: at Function.Module._load (internal/modules/cjs/loader.js:703:12)
May 21 17:32:18 ip-172-31-32-75 web: at Function.Module.runMain (internal/modules/cjs/loader.js:999:10) {
May 21 17:32:18 ip-172-31-32-75 web: code: 'MODULE_NOT_FOUND',
May 21 17:32:18 ip-172-31-32-75 web: requireStack: [ '/var/app/current/node_modules/.bin/node-red' ]
May 21 17:32:18 ip-172-31-32-75 web: }
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! code ELIFECYCLE
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! errno 1
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! Node-red-dev@1.0.0 start: `node-red -s ./settings.js`
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! Exit status 1
May 21 17:32:18 ip-172-31-32-75 web: npm ERR!
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! Failed at the Node-red-dev@1.0.0 start script.
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
May 21 17:32:18 ip-172-31-32-75 web: npm ERR! A complete log of this run can be found in:
May 21 17:32:18 ip-172-31-32-75 web: npm ERR!     /home/webapp/.npm/_logs/2021-05-21T17_32_18_978Z-debug.log

So it looks that the tutorial is actually wrong.
The error is gone when I launch node-red with

node ./node_modules/node-red/red.js --settings settings.js -v

instead of the tutorials'

./node_modules/.bin/node-red -s ./settings.js

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.