@PitaJ said in Help with Upgrade to v1.13.x:
@Michael-Pfaff yeah I'd check git status before doing anything and run reset if there are changes
Much appreciated @PitaJ!
I'm getting this error when trying to upgrade to v1.5.1, any help would be appreciated:
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)
Same error after npm i and rerunning nodebb upgrade. npm ls xregexp gives me:
invalid: [email protected]
Do you know what that means?
Thanks, Len
So, after npm i [email protected] there are a bunch of warnings but then:
[email protected] node_modules/xregexp
However, nodebb upgrade still gives the same error:
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:
└── [email protected] invalid
npm ERR! invalid: [email protected] /home/ljhardy/public_html/nodebb/nodebb/node_modules/xregexp
npm is 2.15.11
nodejs is 4.8.3
after 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)
@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 [email protected] and using the package-lockfile.json thats generated could make these kinds of issues go away.
@bri [email protected] 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 [email protected] should be installed with -g
> [email protected] postinstall /home/ljhardy/public_html/nodebb/nodebb/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js
> [email protected] 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 [email protected]'^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 [email protected]'^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 [email protected]'^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
What the heck? Sqlite3?