运行install命令时出错

时间:2017-02-24 16:13:36

标签: angular npm-install webpack-2

无法理解为什么我会收到此错误,我也尝试以管理员身份运行该命令。

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" "--color=always"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! path C:\csf_workflow\Projects\DataCentralUI\Main\DataCentral\node_modules\node-sass\vendor\win32-x64-48\binding.node
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink

npm ERR! Error: EPERM: operation not permitted, unlink 'C:\XXXXXXXXXXXXX\node_modules\node-sass\vendor\win32-x64-48\binding.node'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\XXXXXXXXXXXXXXX\node_modules\node-sass\vendor\win32-x64-48\binding.node'
npm ERR!     at Error (native)
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\XXXXXXXXXXXXXXXXXX\\node_modules\\node-sass\\vendor\\win32-x64-48\\binding.node',
npm ERR!   parent: 'datacentralui' }
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:\XXXXXXXXXXXXXXXXX\npm-debug.log

1 个答案:

答案 0 :(得分:0)

首先,试试:

npm cache clean

如果这不能解决问题,那可能是清洁并非完全成功,而且仍有残余物。看一下%APPDATA%\ npm-cache,或者如果您使用的是PowerShell,$ env:APPDATA \ npm-cache。手动删除该目录中的所有内容,然后重试。

参考:

http://blogs.msdn.microsoft.com/matt-harrington/2012/02/23/how-to-fix-node-js-npm-permission-problems/