Why does npm need sudo for EVERYTHING?

后端 未结 3 1720
耶瑟儿~
耶瑟儿~ 2021-01-14 14:59

I don\'t know how I\'ve managed it but npm seems to need sudo for absolutely every command, even npm help does not work without sudo. If I use a co

3条回答
  •  滥情空心
    2021-01-14 15:36

    I had this as well on my machine. What I did to fix it (there are probably much less extreme ways) was to completely remove npm, and then did a fresh installation node.js (with which npm is included) from http://nodejs.org/ making sure I didn't install as root. That then allowed me to use npm without root (except for global installs).

提交回复
热议问题