my node app directory sits at /usr/node/express-test/app.js
I followed this thread to set up my environment so that I can have a freelancer come in and install npm packages globally on our server without having to have access to sudo.
How to npm install globally without root
I've checked my NODE_PATH... looks okay to me.
echo $NODE_PATH
/usr/node/.npm-packages/lib/node_modules
However, the error I see when I try to run my app.js appears to be that it cannot find my globally installed express module
app.js
/usr/node/express-test# node app.js
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'express'
Require stack:
- /usr/node/express-test/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/usr/node/express-test/app.js:2:15)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/node/express-test/app.js' ]
}
Ideas to what the problem may be please?