刚刚开始一项新工作,必须在Windows上运行节点(我的所有同事都使用OSX,运行得很好,检查新鲜)
当npm,我一直得到addLocal无法安装,似乎它试图访问%APPDATA%中的临时目录(没有任何特殊权限)我的同事使用相同版本的节点和npm(但在mac)不会看到任何这些。
我也试过将节点降级到10.35,但我遇到了另一个问题。有谁知道可能是什么情况?
这是标准输出:
C:\Users\litehsu\workspace\myworkspace>npm install
npm WARN package.json Dependency 'grunt-sonar-runner' exists in both dependencies and devDependencies, using 'grunt-sonar-runner@2.4.3' from dependencies
npm ERR! addLocal Could not install C:\Users\litehsu\AppData\Local\Temp\npm-5440-6f1004b8\git-cache-ecdc41ed33a0\2fd99696c3f2705dcd6813454b50ad5591651427
npm ERR! addLocal Could not install C:\Users\502438~1\AppData\Local\Temp\npm-5440-6f1004b8\git-cache-87d2760d189d\e52092778d61d32bb10e3aa062bbbfaf583d2107
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path C:\Users\502438914\AppData\Roaming\npm-cache\karma-support\1.0.2\package.tgz
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! enoent ENOENT, scandir 'C:\Users\litehsu\AppData\Roaming\npm-cache\karma-support\1.0.2\package.tgz'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\litehsu\workspace\npm-debug.log
谢谢你!
答案 0 :(得分:0)
使用配置更改位置:
npm config ls -l
将它们更改为新路径。例如:
npm config set cache %USERPROFILE%\npm-cache
npm config set tmp %USERPROFILE%\tmp
会将它们放在个人资料文件夹中。
在所有.npmrc
个文件位置进行相同的修改:
%appdata%\npm\node_modules\npm\.npmrc
%ProgramFiles%\nodejs\node_modules\npm\.npmrc
%USERPROFILE%\.npmrc
<强>参考强>