Search code examples
ghost-blog

Install ghost blog meet `npm WARN cannot run in wd ghost`


while I download ghost ,and unzip it to new_ghost ,then i meet this error

➜  new_ghost npm install --production
npm WARN cannot run in wd ghost@0.11.2 node core/server/utils/npm/preinstall.js (wd=/var/www/new_ghost)
[1]    14831 killed     npm install --production

Solution

  • If you look in package.json you will see the preinstall script. It is looking for node. If you are working on Ubuntu, you might need to change that to nodejs. Another thing to try is:

    npm cache clean
    rm -rf node_modules
    npm install --production
    npm start --production
    

    Another possibility is if you are using a version of node that it doesn't support. In that case you can disable the version check:

    GHOST_NODE_VERSION_CHECK=false npm install --production
    GHOST_NODE_VERSION_CHECK=false npm start --production