npm install -g yo command gives -> ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`

前端 未结 7 585
醉梦人生
醉梦人生 2020-12-31 04:38

I just tried to do a npm install but get this error about doctor,js at the end. Do I need to worry about it?

npm install -g yo

. .



        
7条回答
  •  北海茫月
    2020-12-31 05:08

    I had this same error on a clean Ubuntu 13.10 install and no amount of sym linking (node > nodejs) or installing/uninstalling helped me.

    I don't have a deep enough understanding of the node environment to troubleshoot it properly but I was able to install Yeoman globally by cloning the repo and removing the postinstall check from package.json.

    If anyone else want's to try this solution:

    Clone Yeoman..

    cd ~
    git clone https://github.com/yeoman/yo
    

    Edit the package.json..

    nano yo/package.json
    

    .. to remove these lines..

    "scripts": {
        "test": "grunt",
        "postinstall": "node ./scripts/doctor",
        "postupdate": "node ./scripts/doctor"
    },
    

    Then, install it using npm..

    cd yo
    npm install -g
    

    If you want to clean up you can remove the Yeoman repo..

    cd ..
    rm -R yo/
    

    Obviously your mileage may vary but it's working fine for me so far.

    I also noticed I was able to successfully run the doctor.js script independent of the installation process. No idea why it was failing so hard in the first place..

提交回复
热议问题