Error installing yeoman

前端 未结 5 1555
一整个雨季
一整个雨季 2020-12-14 13:03

Installing Yeoman on my OSX machine results in the following error:

paulh16$ npm install -g yo
npm http GET https://registry.npmjs.org/yo
npm http 304 https:         


        
相关标签:
5条回答
  • 2020-12-14 13:07

    This worked well for me:

    sudo npm install -g yo
    
    0 讨论(0)
  • 2020-12-14 13:12

    For me on Ubuntu only the following worked for me...

    Ubuntu

    Tested on Ubuntu 14.04.2

    This was a base install of Ubuntu 14.04.2 on VirtualBox using ubuntu-trusty-64.

    I had just installed node and npm fresh and they were working well.

    npm install -y -g yo
    echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
    npm config set prefix ~/npm
    echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
    npm install -y -g yo
    

    yes I had to install yeoman, fix the path issues, then reinstall yeoman. based on some answers on this stack overflow post

    0 讨论(0)
  • 2020-12-14 13:13

    try

    sudo chown -R $USER /usr/local

    and this kind of problem would be solved forever

    it's not encouraged to npm with sudo

    0 讨论(0)
  • 2020-12-14 13:19

    The npm command fails because you need to be root to edit files under /usr/.

    You should properly configure npm, see this relevant SO answer:

    $ echo prefix = ~/.node >> ~/.npmrc
    
    0 讨论(0)
  • 2020-12-14 13:33

    This solved the issue for me. Setting the permission on the npm folder in your home directory was the fix for me.

    sudo chown -R `whoami` ~/.npm
    
    0 讨论(0)
提交回复
热议问题