且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何修复 npm 的全局位置?

更新时间:2023-09-11 21:44:16

npm 使用 .npmrc 文件,该文件应位于您的主目录中.(ie ~/.npmrc) 在这个文件中,你应该看到一个键值对,键是前缀".尝试将该值设置为/usr/lib64"之类的值.因此,除了您放入的其他内容之外,您的 .npmrc 文件还将包含以下内容:

npm uses a .npmrc file which should be in your home directory. (ie ~/.npmrc) In this file you should see a key value pair with the key being "prefix". Try setting the value to something like "/usr/lib64". So your .npmrc file would have the following in addition to whatever else you put in it:

prefix = /usr/lib64