Err of Update from 2.8.11 to 3.1.4
-
@PitaJ said in Err of Update from 2.8.11 to 3.1.4:
In fact you should NEVER use sudo to run ./nodebb or npm commands.
Does it have any obvious side effects? I would appreciate it if you could elaborate
-
npm
doesn't work well with sudo and newer versions explicitly warn against this- using sudo gives nodebb more permissions than necessary, which opens the door to much worse pwning if NodeBB has a vulnerability
-
@baris Hello, I tested all cmds as above
nodebb@Rocky:/home/w117$ npm -v 9.6.7 nodebb@Rocky:/home/w117$ node -v v18.16.0 nodebb@Rocky:/home/w117$ npm ls request-promise-native w117@ /home/w117 └── (empty)
ok I won't. I used be that is when I running
./nodebb upgrade
see some error need permission -
@PitaJ said in Err of Update from 2.8.11 to 3.1.4:
In fact you should NEVER use sudo to run ./nodebb or npm commands. Try deleting node_modules and running ./nodebb upgrade again.
Thanks for reply, I get the following error when I run it directly
nodebb@Rocky:/home/w117/nodebb$ ./nodebb upgrade Dependencies outdated or not yet installed. Installing them now... node:internal/modules/cjs/loader:1078 throw err; ^ Error: Cannot find module 'lodash' Require stack: - /home/w117/nodebb/src/cli/package-install.js - /home/w117/nodebb/src/cli/index.js - /home/w117/nodebb/nodebb at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Module.require (node:internal/modules/cjs/loader:1141:19) at require (node:internal/modules/cjs/helpers:110:18) at pkgInstall.updatePackageFile (/home/w117/nodebb/src/cli/package-install.js:36:12) at Object.<anonymous> (/home/w117/nodebb/src/cli/index.js:50:18) at Module._compile (node:internal/modules/cjs/loader:1254:14) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/w117/nodebb/src/cli/package-install.js', '/home/w117/nodebb/src/cli/index.js', '/home/w117/nodebb/nodebb' ] } Node.js v18.16.0
-
@PitaJ said in Err of Update from 2.8.11 to 3.1.4:
npm
doesn't work well with sudo and newer versions explicitly warn against this- using sudo gives nodebb more permissions than necessary, which opens the door to much worse pwning if NodeBB has a vulnerability
Seniors, I found that I can't install npm without using sudo. All operations require system permissions. How can I avoid using sudo?
nodebb@Rocky:/home/w117/nodebb$ npm install npm ERR! code EACCES npm ERR! syscall rename npm ERR! path /home/w117/nodebb/node_modules/@adactive/bootstrap npm ERR! dest /home/w117/nodebb/node_modules/@adactive/.bootstrap-NiU3nRbE npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, rename '/home/w117/nodebb/node_modules/@adactive/bootstrap' -> '/home/w117/nodebb/node_modules/@adactive/.bootstrap-NiU3nRbE' npm ERR! [Error: EACCES: permission denied, rename '/home/w117/nodebb/node_modules/@adactive/bootstrap' -> '/home/w117/nodebb/node_modules/@adactive/.bootstrap-NiU3nRbE'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'rename', npm ERR! path: '/home/w117/nodebb/node_modules/@adactive/bootstrap', npm ERR! dest: '/home/w117/nodebb/node_modules/@adactive/.bootstrap-NiU3nRbE' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: /home/nodebb/.npm/_logs/2023-06-05T09_21_43_155Z-debug-0.log
and nodebb is same case
-
maybe error of permissions on this file/rep. (and maybe other ?)
Personnally, as a general rule, I always do
chown -Rf user:group /home/XXxx/nodebb
on the nodebb directory before upgrading -
-
@DownPW said in Err of Update from 2.8.11 to 3.1.4:
maybe error of permissions on this file/rep. (and maybe other ?)
Personnally, as a general rule, I always do
chown -Rf user:group /home/XXxx/nodebb
on the nodebb directory before upgradingGood call, this fixed similar upgrade error that was causing havoc on my recent 3.1.4 upgrade. Cheers!
-
@DownPW said in Err of Update from 2.8.11 to 3.1.4:
maybe error of permissions on this file/rep. (and maybe other ?)
Personnally, as a general rule, I always do
chown -Rf user:group /home/XXxx/nodebb
on the nodebb directory before upgradingI change all file's user and group to my current user of nodebb, and I checked them by
ll
cmd. But the permissions problem still exists. I do not know why.
-
@baris Hi, I reinstall npm and do every step again.
nodebb@Rocky:/home/w117/nodebb/node_modules$ npm ls request-promise-native [email protected] /home/w117/nodebb └── [email protected]
I don't want to use sudo but every time I running nodebb upgrade it ask me promissions, even I change user:group to my own user still not work, Could you help me find error at this following error information ,Thanks.
nodebb@Rocky:/home/w117/nodebb/node_modules$ sudo ./nodebb upgrade Updating NodeBB... 1. Updating package.json file with defaults... OK 2. Bringing base dependencies up to date... started up to date, audited 978 packages in 4s 98 packages are looking for funding run `npm fund` for details 13 vulnerabilities (7 moderate, 6 high) To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency. Run `npm audit` for details. 3. Checking installed plugins for updates...Checking installed plugins and themes for updates... OK All packages up-to-date! 4. Updating NodeBB data store schema... Parsing upgrade scripts... OK | 0 script(s) found, 123 skipped Schema update complete! 5. Rebuilding assets... started 2023-06-06T08:29:28.413Z [4567/1115148] - info: [build] Building in series mode 2023-06-06T08:29:28.415Z [4567/1115148] - info: [build] plugin static dirs build started 2023-06-06T08:29:28.419Z [4567/1115148] - info: [build] plugin static dirs build completed in 0.004sec 2023-06-06T08:29:28.419Z [4567/1115148] - info: [build] requirejs modules build started 2023-06-06T08:29:28.706Z [4567/1115148] - info: [build] requirejs modules build completed in 0.287sec 2023-06-06T08:29:28.707Z [4567/1115148] - info: [build] client js bundle build started 2023-06-06T08:29:28.711Z [4567/1115148] - info: [build] client js bundle build completed in 0.004sec 2023-06-06T08:29:28.712Z [4567/1115148] - info: [build] admin js bundle build started 2023-06-06T08:29:28.714Z [4567/1115148] - info: [build] admin js bundle build completed in 0.002sec 2023-06-06T08:29:28.715Z [4567/1115148] - info: [build] client side styles build started 2023-06-06T08:29:29.767Z [4567/1115148] - error: [build] client side styles build failed 2023-06-06T08:29:29.768Z [4567/1115148] - error: [build] Encountered error during build step Error occurred during upgrade: Error: Error: Can't find stylesheet to import. ╷ 5 │ @import "./scss/overrides"; │ ^^^^^^^^^^^^^^^^^^ ╵ - 5:9 root stylesheet at handleCompileResponse (/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js:231:15) at compileRequestAsync (/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js:118:16) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.buildCSS (/home/w117/nodebb/src/meta/minifier.js:161:21) at async executeAction (/home/w117/nodebb/src/meta/minifier.js:139:9) at async Minifier.css.bundle (/home/w117/nodebb/src/meta/minifier.js:196:9) at async CSS.buildBundle (/home/w117/nodebb/src/meta/css.js:219:23) at async client side styles (/home/w117/nodebb/src/meta/build.js:36:3) at async step (/home/w117/nodebb/src/meta/build.js:117:3) at async buildTargets (/home/w117/nodebb/src/meta/build.js:105:4) 2023-06-06T08:29:29.773Z [4567/1115148] - error: uncaughtException: Error: Can't find stylesheet to import. ╷ 5 │ @import "./scss/overrides"; │ ^^^^^^^^^^^^^^^^^^ ╵ - 5:9 root stylesheet Error: Error: Can't find stylesheet to import. ╷ 5 │ @import "./scss/overrides"; │ ^^^^^^^^^^^^^^^^^^ ╵ - 5:9 root stylesheet at handleCompileResponse (/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js:231:15) at compileRequestAsync (/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js:118:16) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.buildCSS (/home/w117/nodebb/src/meta/minifier.js:161:21) at async executeAction (/home/w117/nodebb/src/meta/minifier.js:139:9) at async Minifier.css.bundle (/home/w117/nodebb/src/meta/minifier.js:196:9) at async CSS.buildBundle (/home/w117/nodebb/src/meta/css.js:219:23) at async client side styles (/home/w117/nodebb/src/meta/build.js:36:3) at async step (/home/w117/nodebb/src/meta/build.js:117:3) at async buildTargets (/home/w117/nodebb/src/meta/build.js:105:4) {"date":"Tue Jun 06 2023 08:29:29 GMT+0000 (Coordinated Universal Time)","error":{"sassMessage":"Can't find stylesheet to import.","sassStack":"- 5:9 root stylesheet\n","span":{"context":"@import \"./scss/overrides\";\n","end":{"column":26,"line":4,"offset":169},"start":{"column":8,"line":4,"offset":151},"text":"\"./scss/overrides\""}},"exception":true,"os":{"loadavg":[0.29,0.26,0.14],"uptime":5094250.62},"process":{"argv":["/usr/bin/node","/home/w117/nodebb/nodebb","upgrade"],"cwd":"/home/w117/nodebb","execPath":"/usr/bin/node","gid":0,"memoryUsage":{"arrayBuffers":19201859,"external":21263700,"heapTotal":70361088,"heapUsed":58600296,"rss":137633792},"pid":1115148,"uid":0,"version":"v18.16.0"},"stack":"Error: Error: Can't find stylesheet to import.\n\u001b[34m ╷\u001b[0m\n\u001b[34m5 │\u001b[0m @import \u001b[31m\"./scss/overrides\"\u001b[0m;\n\u001b[34m │\u001b[0m \u001b[31m ^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[34m ╵\u001b[0m\n - 5:9 root stylesheet\n at handleCompileResponse (/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js:231:15)\n at compileRequestAsync (/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js:118:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Object.buildCSS (/home/w117/nodebb/src/meta/minifier.js:161:21)\n at async executeAction (/home/w117/nodebb/src/meta/minifier.js:139:9)\n at async Minifier.css.bundle (/home/w117/nodebb/src/meta/minifier.js:196:9)\n at async CSS.buildBundle (/home/w117/nodebb/src/meta/css.js:219:23)\n at async client side styles (/home/w117/nodebb/src/meta/build.js:36:3)\n at async step (/home/w117/nodebb/src/meta/build.js:117:3)\n at async buildTargets (/home/w117/nodebb/src/meta/build.js:105:4)","trace":[{"column":15,"file":"/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js","function":"handleCompileResponse","line":231,"method":null,"native":false},{"column":16,"file":"/home/w117/nodebb/node_modules/sass-embedded/dist/lib/src/compile.js","function":"compileRequestAsync","line":118,"method":null,"native":false},{"column":5,"file":"node:internal/process/task_queues","function":"process.processTicksAndRejections","line":95,"method":"processTicksAndRejections","native":false},{"column":21,"file":"/home/w117/nodebb/src/meta/minifier.js","function":"async Object.buildCSS","line":161,"method":"buildCSS","native":false},{"column":9,"file":"/home/w117/nodebb/src/meta/minifier.js","function":"async executeAction","line":139,"method":null,"native":false},{"column":9,"file":"/home/w117/nodebb/src/meta/minifier.js","function":"async Minifier.css.bundle","line":196,"method":"bundle","native":false},{"column":23,"file":"/home/w117/nodebb/src/meta/css.js","function":"async CSS.buildBundle","line":219,"method":"buildBundle","native":false},{"column":3,"file":"/home/w117/nodebb/src/meta/build.js","function":"async client side styles","line":36,"method":null,"native":false},{"column":3,"file":"/home/w117/nodebb/src/meta/build.js","function":"async step","line":117,"method":null,"native":false},{"column":4,"file":"/home/w117/nodebb/src/meta/build.js","function":"async buildTargets","line":105,"method":null,"native":false}]}
-
@Weeeendi said in Err of Update from 2.8.11 to 3.1.4:
Error occurred during upgrade: Error: Error: Can't find stylesheet to import.
This usually refers to a skin that was not ported over to v3. On your existing installation, change the skin to default and try the upgrade again.
-