当我在命令行npm install karma-jasmine –save-dev
执行时,我收到此错误:
C:\Program Files\nodejs>npm install karma-jasmine -save-dev
npm ERR! addLocal Could not install C:\Program Files\nodejs\-save-dev
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "karma-jasmine" "-save-dev"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path C:\Program Files\nodejs\-save-dev
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! enoent ENOENT, open 'C:\Program Files\nodejs\-save-dev'
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! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "karma-jasmine" "-save-dev"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path C:\Program Files\nodejs\npm-debug.log.571fc1cbfa90babe4129ee8c4f66
eda5
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! Error: EPERM, open 'C:\Program Files\nodejs\npm-debug.log.571fc1cbfa90b
abe4129ee8c4f66eda5'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM, open 'C:\Program Files\nodejs\npm-debug.log.571fc1cbf
a90babe4129ee8c4f66eda5']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\Program Files\\nodejs\\npm-debug.log.571fc1cbfa90babe4129e
e8c4f66eda5' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Program Files\nodejs\npm-debug.log
答案 0 :(得分:1)
“程序文件”是一个特殊的文件夹,需要管理员访问,因此精子错误。
如果您需要在全球范围内安装karma-jasmine,请使用npm install -g karma-jasmine
如果您需要在本地为您的项目安装karma-jasmine,请为项目的根目录使用不同的文件夹并使用npm install karma-jasmine