It is dangerous to run nodebb this way. Do so at your own risk.
I'm not sure exactly what is causing that npm error, but it's not a NodeBB bug. I suggest you look it up yourself.
@meetdilip said:
Care give the command to be used. I am not very good at this.
git stash
should be fine.
I'm assuming you're wanting to go to master branch?
If so,
git checkout master
(If you want stable (recommended) then git checkout v0.5.x
)
git pull
./nodebb upgrade
npm up
./nodebb restart
If you get any errors about plugins wanting certain versions of vanilla or lavender, then disable or uninstall them, then run upgrade/npm up again..
FWIW, there's no 0.5.1 branch, it's either 0.5.x or master, master includes the changes that were in 0.5.1, with some other nuances that may cause instability.
Thanks @a_5mith. Will try them.
No luck. Stuck here
Auto-merging npm-shrinkwrap.json
CONFLICT (add/add): Merge conflict in npm-shrinkwrap.json
@meetdilip said:
No luck. Stuck here
Auto-merging npm-shrinkwrap.json
CONFLICT (add/add): Merge conflict in npm-shrinkwrap.json
I see this when trying to upgrade BitBangers, I dont know enough about git to bypass it myself.
This is stopping me from upgrading too.
@meetdilip What's your output of git status
?
EDIT: I'm guessing what has happened is maybe you manually modified some file(s) in your folder -- which is a git folder. git pull
does several things. I'm not an expert, but among them it does git fetch
& git merge
and I'm not sure what else. Anyway, since you modified some files and it's trying to merge it can't because the file(s) are different. So, first you have to do a git status
to see what's going on. Then, from the looks of the output you've already shown you'll have to do something with the npm-shrinkwrap.json file.
You can also try git diff
which might give you some more info about what's different since you've already tried to git pull
Basically, git doesn't want to merge because it doesn't know which file(s) you want to keep...the one getting pulled in or the one you've modified. It could be something as simple as an extra space somewhere, or even just a different timestamp (I think) on the file.
Disclaimer: As I've already stated, I'm not an expert with git -- still learning it myself -- so this may not be exact.
Thanks @mootzville . Only changes I made are installing a few themes and plugins. I have not made any manual edit to any of the files as far as I can remember.
git status result
new file: public/less/mixins.less
I must also thank @frissdiegurke who tried to help me in between.
Restored using snapshotp and git status gave
[email protected]:~/home/nodebb# git status
nothing added to commit but untracked files present (use "git add" to track)
[email protected]:~/home/nodebb#
@meetdilip, open npm-shrinkwrap.json
with a text editor and replace its content with the contents of this file.
After you've done that do a git add npm-shrinkwrap.json
, git commit -am "updated files"
and git push
and things should be working.
@meetdilip said:
Restored using snapshotp and git status gave [...]
That just means that the public/google-adsense.config.json
isn't being tracked by git (it isn't under source control). Most likely that file was added by some NodeBB plugin.
You can either add it to the git repo using git add pulic/google-adsense.config.json
and then git commit -am "added adsense config file"
and git push
to update the remote repository, or ignore that message.
So nice of you @fuzzmz . I am just need to try the last step then, right ?
@fuzzmz said:
git add pulic/google-adsense.config.json
[email protected]:~# git add pulic/google-adsense.config.json
fatal: Not a git repository (or any of the parent directories): .git
[email protected]:~# cd home/nodebb
[email protected]:~/home/nodebb# git add pulic/google-adsense.config.json
fatal: pathspec 'pulic/google-adsense.config.json' did not match any files
[email protected]:~/home/nodebb#
@meetdilip it should be public
instead of pulic
. Sorry for the typo
Techiewiz running on 0.5.1 Thanks to @fuzzmz and all.
@meetdilip Glad to hear.
Also, I have been reading a great book about git you might want to look into. It's called 'Version Control with Git' and it's written by a couple of guys that work at github. It's published by O'Reilly.
Thanks @mootzville
A free and really good alternative to the book mentioned by @mootzville is Git - Book. It teaches best practices, as well as providing both in depth information and quick reference.
error: Cannot find module '../public/src/templates'
Error: Cannot find module '../public/src/templates'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at Object.<anonymous> (E:\nodejs\tpc\node_modules\nodebb-plugin-cash\library
.js:7:28)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
error: Connection Closed By Application
error: undefined
info: [app] Database connection closed.
Don't know why it always shows up this error when I start the nodeBB after upgrade. My git say everything is up-to-date.
@Hưng-Thành-Nguyễn I'm wagering the "cash" plugin is not compatible with the latest version. You might want to remove it:
./nodebb reset plugin="nodebb-plugin-cash"