try the commands here https://community.nodebb.org/topic/8285/easy-nodebb-upgrade-process
Upgrading to Nodebb v1.5.1
-
I'm getting this error when trying to upgrade to v1.5.1, any help would be appreciated:
- Bringing base dependencies up to date... OK
- Checking installed plugins for updates... OK
- Updating NodeBB data store schema...
/home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:37
invalidUnicodeChars: XRegExp('[^\p{L}\s\d\-_]', 'g'),
^
TypeError: XRegExp is not a function
at /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:37:24
at /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:8:20
at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:27:2)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/src/utils.js:3:18) -
That's weird, try running
npm i
and then trying again. Maybe check to make sure XRegExp is installed bynpm ls xregexp
-
Same error after npm i and rerunning nodebb upgrade. npm ls xregexp gives me:
invalid: xregexp@2.0.0
Do you know what that means?
Thanks, Len
-
XRegExp should be "xregexp": "3.2.0",
Try
npm r xregexp
and thennpm i xregexp@3.2.0
-
So, after npm i xregexp@3.2.0 there are a bunch of warnings but then:
xregexp@3.2.0 node_modules/xregexp
However, nodebb upgrade still gives the same error:
- Bringing base dependencies up to date... OK
- Checking installed plugins for updates... OK
- Updating NodeBB data store schema...
/home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:37
invalidUnicodeChars: XRegExp('[^\p{L}\s\d\-_]', 'g'),
^
TypeError: XRegExp is not a function
at /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:37:24
at /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:8:20
at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:27:2)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/src/utils.js:3:18)Error: undefined
And, npm ls xregexp still shows:
└── xregexp@2.0.0 invalid
npm ERR! invalid: xregexp@2.0.0 /home/ljhardy/public_html/nodebb/nodebb/node_modules/xregexp
-
What is your nodejs/npm version? Does it still happen if you remove the
node_modules
folder and runnpm i
again? -
npm is 2.15.11
nodejs is 4.8.3after removing node_modules and running "npm i", "nodebb upgrade" gives me this:
odeBB could not be initialised because there was an error while loading dependencies.
Please run "npm install --production" and try again.For more information, please see: https://docs.nodebb.org/en/latest/installing/os.html
/home/ljhardy/public_html/nodebb/nodebb/nodebb:46
throw e;
^Error: Cannot find module 'prompt'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/nodebb:37:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)I ran "npm install --production", then "./nodebb upgrade" again gives the same error as previous:
odeBB could not be initialised because there was an error while loading dependencies.
Please run "npm install --production" and try again.For more information, please see: https://docs.nodebb.org/en/latest/installing/os.html
/home/ljhardy/public_html/nodebb/nodebb/nodebb:46
throw e;
^Error: Cannot find module 'prompt'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/nodebb:37:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10) -
Any more ideas?
-
@ljhardy said in Upgrading to Nodebb v1.5.1:
/home/ljhardy/public_html/nodebb/nodebb/
You are running the npm i and upgrade commands in the root folder of the nodebb installation right? So package.json is at
/home/ljhardy/public_html/nodebb/nodebb/package.json
? Also the NodeBB files shouldn't be in a web accessible folder not sure if its just your folder name or you are actually serving the public_html folder with a webserver. -
BTW, getting full actual terminal logs would be good, including all of the commands for these things, so we can see where the commands are run, etc.
Also, use triple backticks to make a code block
``` someCode(); ```
goes to
someCode();
-
npm i npm upgrade
are run in the nodebb root folder.
I'm assuming that when you say that the NodeBB files shouldn't be web server accessible, that is a security concern and not a potential cause of my issue? I will change that, but it has been running fine (although probably insecurely, based on your point) for a couple of years.
I will try the commands again and paste in the entire log stream that is showing on the terminal.
Thanks for the help here.
-
FWIW @julian @baris @psychobunny upgrading to npm@5 and using the package-lockfile.json thats generated could make these kinds of issues go away.
-
@bri npm@5 has some development usability issues. Namely, npm link is broken as an npm i in the main directory will dedupe out of linked modules, breaking lots of things.
-
output of
npm i
> node scripts/install.js npm WARN prefer global jison@0.4.13 should be installed with -g > jsonpath@0.2.11 postinstall /home/ljhardy/public_html/nodebb/nodebb/node_modules/jsonpath > node lib/aesprim.js > generated/aesprim-browser.js > sqlite3@3.1.8 install /home/ljhardy/public_html/nodebb/nodebb/node_modules/sqlite3 > node-pre-gyp install --fallback-to-build [sqlite3] Success: "/home/ljhardy/public_html/nodebb/nodebb/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile npm WARN unmet dependency /home/ljhardy/public_html/nodebb/nodebb/node_modules/nock/node_modules/changelog requires chalk@'^0.5.1' but will load npm WARN unmet dependency /home/ljhardy/public_html/nodebb/nodebb/node_modules/chalk, npm WARN unmet dependency which is version 1.1.3 npm WARN unmet dependency /home/ljhardy/public_html/nodebb/nodebb/node_modules/nock/node_modules/changelog requires semver@'^4.0.3' but will load npm WARN unmet dependency /home/ljhardy/public_html/nodebb/nodebb/node_modules/semver, npm WARN unmet dependency which is version 5.3.0 npm WARN unmet dependency /home/ljhardy/public_html/nodebb/nodebb/node_modules/nock/node_modules/changelog requires wordwrap@'^0.0.2' but will load npm WARN unmet dependency /home/ljhardy/public_html/nodebb/nodebb/node_modules/wordwrap, npm WARN unmet dependency which is version 0.0.3
output of
nodebb upgrade
1. Bringing base dependencies up to date... OK 2. Checking installed plugins for updates... OK 3. Updating NodeBB data store schema... /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:37 invalidUnicodeChars: XRegExp('[^\\p{L}\\s\\d\\-_]', 'g'), ^ TypeError: XRegExp is not a function at /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:37:24 at /home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:8:20 at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/public/src/utils.js:27:2) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/ljhardy/public_html/nodebb/nodebb/src/utils.js:3:18) Error: undefined
-
Have you nuked your
node_modules/
folder and triednpm i --production
? It seems npm is getting quite confused with your folder... -
What the heck? Sqlite3?
-
@Bri - I'm using mongodb, why would sqllite be referenced?
-
I have a current mongodb backup. Would it be possible for me to remove everything, install the latest version of Nodebb and then restore all of the data? How would I do that?
Thanks, I really appreciate the help here.
-
Ok, I actually had a full directory backup of nodebb from a couple of months ago. I restored that and am able to start nodebb. Now I'll start the upgrade again.
-
Success!!! Thanks guys.
Suggested Topics
-
SOLVED NodeBB Crashing?
Technical Support • • Marvin