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

**URL:** <https://discourse.nodered.org/t/aws-install-cannot-find-module-lib-red-js/46048>\
**Category:** General\
**Created:** [21 May 2021 17:43 UTC](https://discourse.nodered.org/t/aws-install-cannot-find-module-lib-red-js/46048 "2021-05-21T17:43:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![etawyy](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@etawyy](https://discourse.nodered.org/u/etawyy)\
**Post date:** [21 May 2021 17:43 UTC](https://discourse.nodered.org/t/aws-install-cannot-find-module-lib-red-js/46048/1 "2021-05-21T17:43:57Z")

</div>

I have followed that guide to install an instance of nodered on AWS: [Running on Amazon Web Services : Node-RED](https://nodered.org/docs/getting-started/aws#running-on-aws-ebs)  
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?

```auto
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

```

---

<div class="post-metadata">

**Author:** ![etawyy](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@etawyy](https://discourse.nodered.org/u/etawyy)\
**Post date:** [26 May 2021 09:52 UTC](https://discourse.nodered.org/t/aws-install-cannot-find-module-lib-red-js/46048/2 "2021-05-26T09:52:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 June 2021 09:52 UTC](https://discourse.nodered.org/t/aws-install-cannot-find-module-lib-red-js/46048/3 "2021-06-09T09:52:26Z")

</div>

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