我跑了
npm config set prefix /usr/local
运行该命令后,当我尝试在Windows操作系统上运行任何npm命令时,始终会收到以下提示。
Error: EPERM: operation not permitted, mkdir 'C:\Program Files (x86)\Git\local'
at Error (native)
已从所有文件中删除
C:\Users\<your username>\.config\configstore\
它没有起作用。
有什么建议吗?
npm cache clean --force
解决了我的问题。 - Nuhmancmd.exe
的“终端”(命令提示符)中运行它还是从GitBash
终端中运行的?对我来说,当我在GitBash
中运行它时失败了,但是当我在cmd
中运行它时正常工作。 - Henkecmd.exe
中遇到了 EPERM 错误。但是我在C:\Program Files\nodejs
目录下运行了以下命令,似乎它起作用了:npm cache clean --force && npm install <package-name> --force --global
。我还将C:\Program Files\nodejs\node_modules
添加到了系统的PATH
环境变量中。 - Henke