NPM permission error while installing

前端 未结 4 1433
别那么骄傲
别那么骄傲 2021-01-14 09:19

i am trying to install yeoman on my server but for some reason do i keep getting a permission denied error.

$npm install -g yo
/root/.node/bin/yo -> /root         


        
4条回答
  •  不要未来只要你来
    2021-01-14 09:44

    I think Shantaru is right, you need to do it with sudo.

    Try this

    sudo npm uninstall -g yo
    sudo npm cache clean
    sudo npm install -g yo
    

    I have a similar problem weeks ago and that works.

    Edit: If that didn't work, do this before:

    npm config set unsafe-perm true
    

提交回复
热议问题