Question

Ghost Upgrade NPM Cannot Run in WD Error

I am trying to upgrade to Ghost 0.7.9 and followed the directions of upgrading to a node version 4.2.x < 5.x.x (My version is 4.7.3) and had no issues following all of the steps until I reached having to run npm install --production for some reason I’m getting npm WARN cannot run in wd ghost@0.7.9 npm install semver && node -e "require('./core/server/utils/startup-check.js').nodeVersion()" (wd=/var/www/ghost) and can’t seem to figure out a solution. I’m running my droplet via SSH with a root user. Could it be my root user permissions for NPM?

Full run:

npm WARN cannot run in wd ghost@0.7.9 npm install semver && node -e "require('./core/server/utils/startup-check.js').nodeVersion()" (wd=/var/www/ghost)
 
> jsonpath@0.2.2 postinstall /var/www/ghost/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js


\

I also tried running npm cache clean and rm -rf node_moudles, but still received the same result. Any help or guidance?

Not sure if this detail helps, but I followed the chown -R ghost:ghost core command presented in step 6 of the ghost upgrade documentation and curious if that impacted the root user that I’m logged in as. Would it?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

@connordphillips

At the end of the message, does it by chance echo out killed? I ask as this is common on VPS’s with lower resources. Since npm tends to use quite a bit of resources when initially installing all modules expected by an application (i.e. RAM/Memory), if you run out, it’ll simply kill off the process and fail.

So if you’re running this on a 512MB Droplet, and you see killed, that’s one potential reason. If this is a 1GB Droplet, last I tested, Ghost will install without any issues, though if you’re still seeing killed, then you may have to upgrade to a 2GB.

If you’re not seeing killed echo’ed out, if you run it adding --unsafe-perm to the end, does it work?