Error installing new module

2021-09-15T18:46:49.305Z [out]
2021-09-15T18:46:49.305Z [out] > sqlite3@4.1.1 install /home/pi/.node-red/node_modules/sqlite3
2021-09-15T18:46:49.305Z [out] > node-pre-gyp install --fallback-to-build
2021-09-15T18:46:49.305Z [out]
2021-09-15T18:46:49.660Z [err] internal/modules/cjs/loader.js:892
2021-09-15T18:46:49.660Z [err] throw err;
2021-09-15T18:46:49.660Z [err] ^
2021-09-15T18:46:49.660Z [err]
2021-09-15T18:46:49.660Z [err] Error: Cannot find module '../'
Preformatted text2021-09-15T18:46:49.660Z [err] Require stack:
2021-09-15T18:46:49.660Z [err] - /home/pi/.node-red/node_modules/.bin/node-pre-gyp
2021-09-15T18:46:49.660Z [err] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
2021-09-15T18:46:49.660Z [err] at Function.Module._load (internal/modules/cjs/loader.js:745:27)
2021-09-15T18:46:49.660Z [err] at Module.require (internal/modules/cjs/loader.js:961:19)
2021-09-15T18:46:49.660Z [err] at require (internal/modules/cjs/helpers.js:92:18)
2021-09-15T18:46:49.660Z [err] at Object. (/home/pi/.node-red/node_modules/.bin/node-pre-gyp:15:20)
2021-09-15T18:46:49.660Z [err] at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-09-15T18:46:49.660Z [err] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-09-15T18:46:49.660Z [err] at Module.load (internal/modules/cjs/loader.js:937:32)
2021-09-15T18:46:49.660Z [err] at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-09-15T18:46:49.660Z [err] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
2021-09-15T18:46:49.660Z [err] code: 'MODULE_NOT_FOUND',
2021-09-15T18:46:49.660Z [err] requireStack: [ '/home/pi/.node-red/node_modules/.bin/node-pre-gyp' ]
2021-09-15T18:46:49.660Z [err] }
2021-09-15T18:46:51.847Z [err] npm
2021-09-15T18:46:51.848Z [err] WARN node-red-project@0.0.1 No repository field.
2021-09-15T18:46:51.893Z [err] npm
2021-09-15T18:46:51.893Z [err] WARN node-red-project@0.0.1 No license field.
2021-09-15T18:46:51.894Z [err]
2021-09-15T18:46:52.341Z [err] npm
2021-09-15T18:46:52.342Z [err] ERR! code ELIFECYCLE
2021-09-15T18:46:52.342Z [err] npm ERR! errno 1
2021-09-15T18:46:52.362Z [err] npm
2021-09-15T18:46:52.363Z [err] ERR! sqlite3@4.1.1 install: node-pre-gyp install --fallback-to-build
2021-09-15T18:46:52.363Z [err] npm ERR! Exit status 1
2021-09-15T18:46:52.363Z [err] npm ERR!
2021-09-15T18:46:52.363Z [err]
2021-09-15T18:46:52.363Z [err] npm ERR! Failed at the sqlite3@4.1.1 install script.
2021-09-15T18:46:52.363Z [err] npm
2021-09-15T18:46:52.363Z [err] ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-09-15T18:46:52.975Z [err]
2021-09-15T18:46:52.976Z [err] npm ERR! A complete log of this run can be found in:
2021-09-15T18:46:52.976Z [err] npm ERR! /home/pi/.npm/_logs/2021-09-15T18_46_52_379Z-debug.logPreformatted text

Which node are you trying to install? Go into your .node-red folder and attempt the install using
npm install whatever_the_node_is_called
and post the full output here please.

it happens with every module. i wanted to install sqlite so using

npm i --unsafe-perm node-red-node-sqlite

same output when trying install node-red-contrib-os 0.2.1

is this a problem?

2021-09-15T18:46:49.660Z [err] Error: Cannot find module '../'

I did ask for the full output.


2021-09-15T18:36:59.216Z Installieren : node-red-node-sqlite 1.0.1

2021-09-15T18:36:59.301Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-node-sqlite@1.0.1
2021-09-15T18:37:18.030Z [err] npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
2021-09-15T18:37:29.640Z [out]
2021-09-15T18:37:29.640Z [out] > sqlite3@5.0.2 install /home/pi/.node-red/node_modules/sqlite3
2021-09-15T18:37:29.640Z [out] > node-pre-gyp install --fallback-to-build
2021-09-15T18:37:29.640Z [out]
2021-09-15T18:37:30.000Z [err] internal/modules/cjs/loader.js:892
2021-09-15T18:37:30.000Z [err] throw err;
2021-09-15T18:37:30.000Z [err] ^
2021-09-15T18:37:30.000Z [err]
2021-09-15T18:37:30.000Z [err] Error: Cannot find module '../'
2021-09-15T18:37:30.000Z [err] Require stack:
2021-09-15T18:37:30.000Z [err] - /home/pi/.node-red/node_modules/.bin/node-pre-gyp
2021-09-15T18:37:30.000Z [err] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
2021-09-15T18:37:30.000Z [err] at Function.Module._load (internal/modules/cjs/loader.js:745:27)
2021-09-15T18:37:30.000Z [err] at Module.require (internal/modules/cjs/loader.js:961:19)
2021-09-15T18:37:30.000Z [err] at require (internal/modules/cjs/helpers.js:92:18)
2021-09-15T18:37:30.000Z [err] at Object. (/home/pi/.node-red/node_modules/.bin/node-pre-gyp:15:20)
2021-09-15T18:37:30.000Z [err] at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-09-15T18:37:30.000Z [err] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-09-15T18:37:30.000Z [err] at Module.load (internal/modules/cjs/loader.js:937:32)
2021-09-15T18:37:30.000Z [err] at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-09-15T18:37:30.000Z [err] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
2021-09-15T18:37:30.000Z [err] code: 'MODULE_NOT_FOUND',
2021-09-15T18:37:30.000Z [err] requireStack: [ '/home/pi/.node-red/node_modules/.bin/node-pre-gyp' ]
2021-09-15T18:37:30.000Z [err] }
2021-09-15T18:37:32.162Z [err] npm
2021-09-15T18:37:32.163Z [err] WARN node-red-project@0.0.1 No repository field.
2021-09-15T18:37:32.212Z [err] npm WARN
2021-09-15T18:37:32.213Z [err] node-red-project@0.0.1 No license field.
2021-09-15T18:37:32.213Z [err]
2021-09-15T18:37:32.300Z [err] npm
2021-09-15T18:37:32.301Z [err] ERR! code ELIFECYCLE
2021-09-15T18:37:32.301Z [err] npm ERR! errno 1
2021-09-15T18:37:32.321Z [err] npm
2021-09-15T18:37:32.322Z [err] ERR! sqlite3@5.0.2 install: node-pre-gyp install --fallback-to-build
2021-09-15T18:37:32.322Z [err] npm ERR! Exit status 1
2021-09-15T18:37:32.322Z [err] npm ERR!
2021-09-15T18:37:32.322Z [err]
2021-09-15T18:37:32.322Z [err] npm ERR! Failed at the sqlite3@5.0.2 install script.
2021-09-15T18:37:32.322Z [err] npm ERR!
2021-09-15T18:37:32.323Z [err] This is probably not a problem with npm. There is likely additional logging output above.
2021-09-15T18:37:32.373Z [err]
2021-09-15T18:37:32.374Z [err] npm ERR! A complete log of this run can be found in:
2021-09-15T18:37:32.374Z [err] npm ERR! /home/pi/.npm/_logs/2021-09-15T18_37_32_339Z-debug.log
2021-09-15T18:37:32.405Z rc=1

How did you install node-red?
What version of npm and nodejs have you got, use node -v and npm -v to find out

node -v
v14.17.5
npm -v
6.14.14

Please answer all questions.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

via the instructions on node-red.

i did an update on node.js..might this cause the problem

Try deleting node_modules & reinstall...

cd .node-red
rm -rf node_modules/
npm install

Yes, how did you update?

good question.

honestly i dont know. i did cuase i need for some grafana requirements which im using too. so maybe its a good idea to remove and install new?

Follow @Steve-Mcl's suggestion. That may well sort it.

If Steve's suggestion doesn't sort it then
sudo apt-get remove nodejs
and then run the node red install script again, but add on the end of the command --node14 to install that version.

thank u that fixed it

What fixed it?

this one fixed it

1 Like