Upgrade v3.4.1 to v3.4.2 | error: uncaughtException: Cannot find module '/opt/nodebb/node_modules/request-promise-native/lib/rp.js
-
Hi guys,
My system:
- Ubuntu 22
- npm 10.1.0
- nodejs 18.7.1
I just upgraded my nodebb from v3.4.2 to v3.4.3.
After
./nodebb start ./nodebb log
I get the following error:
2023-09-25T19:12:43.999Z [4567/2705558] - error: uncaughtException: Cannot find module '/opt/nodebb/node_modules/request-promise-native/lib/rp.js'. Please verify that the package.json has a valid "main" entry Error: Cannot find module '/opt/nodebb/node_modules/request-promise-native/lib/rp.js'. Please verify that the package.json has a valid "main" entry at tryPackage (node:internal/modules/cjs/loader:438:19) at Module._findPath (node:internal/modules/cjs/loader:680:18) at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27) at Module._load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at Object.<anonymous> (/opt/nodebb/src/cli/upgrade-plugins.js:4:17) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) {"date":"Mon Sep 25 2023 21:12:43 GMT+0200 (GMT+02:00)","error":{"code":"MODULE_NOT_FOUND","path":"/opt/nodebb/node_modules/request-promise-native/package.json","requestPath":"request-promise-native"},"exception":true,"os":{"loadavg":[0.07,0.16,0.22],"uptime":1845387.28},"process":{"argv":["/usr/bin/node","/opt/nodebb/nodebb","upgrade"],"cwd":"/opt/nodebb","execPath":"/usr/bin/node","gid":10003,"memoryUsage":{"arrayBuffers":552776,"external":1183939,"heapTotal":21532672,"heapUsed":16322352,"rss":67162112},"pid":2705558,"uid":10003,"version":"v18.17.1"},"stack":"Error: Cannot find module '/opt/nodebb/node_modules/request-promise-native/lib/rp.js'. Please verify that the package.json has a valid \"main\" entry\n at tryPackage (node:internal/modules/cjs/loader:438:19)\n at Module._findPath (node:internal/modules/cjs/loader:680:18)\n at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)\n at Module._load (node:internal/modules/cjs/loader:922:27)\n at Module.require (node:internal/modules/cjs/loader:1143:19)\n at require (node:internal/modules/cjs/helpers:121:18)\n at Object.<anonymous> (/opt/nodebb/src/cli/upgrade-plugins.js:4:17)\n at Module._compile (node:internal/modules/cjs/loader:1256:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n at Module.load (node:internal/modules/cjs/loader:1119:32)","trace":[{"column":19,"file":"node:internal/modules/cjs/loader","function":"tryPackage","line":438,"method":null,"native":false},{"column":18,"file":"node:internal/modules/cjs/loader","function":"Module._findPath","line":680,"method":"_findPath","native":false},{"column":27,"file":"node:internal/modules/cjs/loader","function":"Module._resolveFilename","line":1063,"method":"_resolveFilename","native":false},{"column":27,"file":"node:internal/modules/cjs/loader","function":"Module._load","line":922,"method":"_load","native":false},{"column":19,"file":"node:internal/modules/cjs/loader","function":"Module.require","line":1143,"method":"require","native":false},{"column":18,"file":"node:internal/modules/cjs/helpers","function":"require","line":121,"method":null,"native":false},{"column":17,"file":"/opt/nodebb/src/cli/upgrade-plugins.js","function":null,"line":4,"method":null,"native":false},{"column":14,"file":"node:internal/modules/cjs/loader","function":"Module._compile","line":1256,"method":"_compile","native":false},{"column":10,"file":"node:internal/modules/cjs/loader","function":"Module._extensions..js","line":1310,"method":".js","native":false},{"column":32,"file":"node:internal/modules/cjs/loader","function":"Module.load","line":1119,"method":"load","native":false}]}
and I had a look here:
/opt/nodebb/node_modules/request-promise-native/lib/rp.js
The file is really missing, but why?
Last update from v2.8 to 3.4.1 no problem.
Any ideas, suggestions, etc ... ?
Very appreciated.Have a nice evening
tecy -
Hi folks,
I am grateful, that I can give something back to the community.
This is only the short excerpt of the console.
But the forum is workingBasically, I was just installing the modules, which nodebb meant where missing.
that did the job.This is my solution,
may it be helpful to others.$ ./nodebb upgrade Error: Cannot find module '/opt/nodebb/node_modules/request-promise-native/lib/rp.js'. $ npm install request-promise-native $ ./nodebb upgrade error: uncaughtException: Cannot find module 'request-promise-core/configure/request2' $ npm install request-promise-core $ ./nodebb upgrade error: Error: Cannot find module 'stealthy-require' $ npm install stealthy-require NodeBB v3.4.2 Copyright (C) 2013-2023 NodeBB Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. For the full license, please visit: http://www.gnu.org/copyleft/gpl.html Clustering enabled: Spinning up 1 process(es). 2023-09-27T12:18:09.201Z [4567/2922161] - info: Initializing NodeBB v3.4.2 [...] 2023-09-27T12:18:11.071Z [4567/2922161] - info: [api] Adding 0 route(s) to `api/v3/plugins` 2023-09-27T12:18:11.087Z [4567/2922161] - info: [router] Routes added 2023-09-27T12:18:11.090Z [4567/2922161] - info: 🎉 NodeBB Ready 2023-09-27T12:18:11.091Z [4567/2922161] - info: 🤝 Enabling 'trust proxy' 2023-09-27T12:18:11.093Z [4567/2922161] - info: 📡 NodeBB is now listening on: 0.0.0.0:4567 2023-09-27T12:18:11.093Z [4567/2922161] - info: 🔗 Canonical URL:
-
I'd recommend trying deleting
node_modules
and then runningnpm install
-
Hi @PitaJ
I tried that. Nothing changed.
Same error msg.
BTW. I installed and upgraded nodebb by special user "nodebb" NOT root.I copied rp.js from here
- https://raw.githubusercontent.com/request/request-promise-native/master/lib/rp.js
and created file rp.js in the respectoive folder: - nodebb/node_modules/request-promise-native/lib
But the other errors arise:
2023-09-27T12:13:35.245Z [4567/2921675] - error: uncaughtException: Cannot find module 'request-promise-core/configure/request2' Require stack: - /opt/nodebb/node_modules/request-promise-native/lib/rp.js - /opt/nodebb/src/cli/upgrade-plugins.js - /opt/nodebb/src/cli/upgrade.js - /opt/nodebb/src/cli/index.js - /opt/nodebb/nodebb Error: Cannot find module 'request-promise-core/configure/request2' Require stack: - /opt/nodebb/node_modules/request-promise-native/lib/rp.js - /opt/nodebb/src/cli/upgrade-plugins.js - /opt/nodebb/src/cli/upgrade.js - /opt/nodebb/src/cli/index.js - /opt/nodebb/nodebb at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at Object.<anonymous> (/opt/nodebb/node_modules/request-promise-native/lib/rp.js:3:17) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) {"date":"Wed Sep 27 2023 14:13:35 GMT+0200 (GMT+02:00)","error":{"code":"MODULE_NOT_FOUND","requireStack":["/opt/nodebb/node_modules/request-promise-native/lib/rp.js","/opt/nodebb/src/cli/upgrade-plugins.js","/opt/nodebb/src/cli/upgrade.js","/opt/nodebb/src/cli/index.js","/opt/nodebb/nodebb"]},"exception":true,"os":{"loadavg":[0,0.05,0.02],"uptime":1993038.53},"process":{"argv":["/usr/bin/node","/opt/nodebb/nodebb","upgrade"],"cwd":"/opt/nodebb","execPath":"/usr/bin/node","gid":10003,"memoryUsage":{"arrayBuffers":552776,"external":1183939,"heapTotal":21794816,"heapUsed":16677008,"rss":66048000},"pid":2921675,"uid":10003,"version":"v18.17.1"},"stack":"Error: Cannot find module 'request-promise-core/configure/request2'\nRequire stack:\n- /opt/nodebb/node_modules/request-promise-native/lib/rp.js\n- /opt/nodebb/src/cli/upgrade-plugins.js\n- /opt/nodebb/src/cli/upgrade.js\n- /opt/nodebb/src/cli/index.js\n- /opt/nodebb/nodebb\n at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)\n at Module._load (node:internal/modules/cjs/loader:922:27)\n at Module.require (node:internal/modules/cjs/loader:1143:19)\n at require (node:internal/modules/cjs/helpers:121:18)\n at Object.<anonymous> (/opt/nodebb/node_modules/request-promise-native/lib/rp.js:3:17)\n at Module._compile (node:internal/modules/cjs/loader:1256:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n at Module.load (node:internal/modules/cjs/loader:1119:32)\n at Module._load (node:internal/modules/cjs/loader:960:12)\n at Module.require (node:internal/modules/cjs/loader:1143:19)","trace":[{"column":15,"file":"node:internal/modules/cjs/loader","function":"Module._resolveFilename","line":1077,"method":"_resolveFilename","native":false},{"column":27,"file":"node:internal/modules/cjs/loader","function":"Module._load","line":922,"method":"_load","native":false},{"column":19,"file":"node:internal/modules/cjs/loader","function":"Module.require","line":1143,"method":"require","native":false},{"column":18,"file":"node:internal/modules/cjs/helpers","function":"require","line":121,"method":null,"native":false},{"column":17,"file":"/opt/nodebb/node_modules/request-promise-native/lib/rp.js","function":null,"line":3,"method":null,"native":false},{"column":14,"file":"node:internal/modules/cjs/loader","function":"Module._compile","line":1256,"method":"_compile","native":false},{"column":10,"file":"node:internal/modules/cjs/loader","function":"Module._extensions..js","line":1310,"method":".js","native":false},{"column":32,"file":"node:internal/modules/cjs/loader","function":"Module.load","line":1119,"method":"load","native":false},{"column":12,"file":"node:internal/modules/cjs/loader","function":"Module._load","line":960,"method":"_load","native":false},{"column":19,"file":"node:internal/modules/cjs/loader","function":"Module.require","line":1143,"method":"require","native":false}]}
- https://raw.githubusercontent.com/request/request-promise-native/master/lib/rp.js
-
Hi folks,
I am grateful, that I can give something back to the community.
This is only the short excerpt of the console.
But the forum is workingBasically, I was just installing the modules, which nodebb meant where missing.
that did the job.This is my solution,
may it be helpful to others.$ ./nodebb upgrade Error: Cannot find module '/opt/nodebb/node_modules/request-promise-native/lib/rp.js'. $ npm install request-promise-native $ ./nodebb upgrade error: uncaughtException: Cannot find module 'request-promise-core/configure/request2' $ npm install request-promise-core $ ./nodebb upgrade error: Error: Cannot find module 'stealthy-require' $ npm install stealthy-require NodeBB v3.4.2 Copyright (C) 2013-2023 NodeBB Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. For the full license, please visit: http://www.gnu.org/copyleft/gpl.html Clustering enabled: Spinning up 1 process(es). 2023-09-27T12:18:09.201Z [4567/2922161] - info: Initializing NodeBB v3.4.2 [...] 2023-09-27T12:18:11.071Z [4567/2922161] - info: [api] Adding 0 route(s) to `api/v3/plugins` 2023-09-27T12:18:11.087Z [4567/2922161] - info: [router] Routes added 2023-09-27T12:18:11.090Z [4567/2922161] - info: 🎉 NodeBB Ready 2023-09-27T12:18:11.091Z [4567/2922161] - info: 🤝 Enabling 'trust proxy' 2023-09-27T12:18:11.093Z [4567/2922161] - info: 📡 NodeBB is now listening on: 0.0.0.0:4567 2023-09-27T12:18:11.093Z [4567/2922161] - info: 🔗 Canonical URL:
-