2017-08-15 1721 views
0

以管理員身份從Windows Powershell運行,我嘗試了以下所有操作。什麼都沒有不僅如此,需要20分鐘才能發現錯誤。npm ERR!錯誤:EPERM:操作不允許

  • 升級節點
  • Upgradeing NPM
  • 關閉殺毒
  • 清潔MPM緩存
  • 驗證NPM緩存

這裏是試圖建立一個項目的輸出:

PS D:\Documents\js> create-react-app socket-io-client 

Creating a new React app in D:\Documents\js\socket-io-client. 

Installing packages. This might take a couple of minutes. 
Installing react, react-dom, and react-scripts... 


> [email protected] postinstall D:\Documents\js\socket-io-client\node_modules\uglifyjs-webpack-plugin 
> node lib/post_install.js 

npm ERR! path D:\Documents\js\socket-io-client\node_modules\fsevents\node_modules 
npm ERR! code EPERM 
npm ERR! errno -4048 
npm ERR! syscall rmdir 
npm ERR! Error: EPERM: operation not permitted, rmdir 'D:\Documents\js\socket-io-client\node_modules\fsevents\node_modules' 
npm ERR! { Error: EPERM: operation not permitted, rmdir 'D:\Documents\js\socket-io-client\node_modules\fsevents\node_modules' 
npm ERR! stack: 'Error: EPERM: operation not permitted, rmdir \'D:\\Documents\\js\\socket-io-client\\node_modules\\fsevents\\node_modules\'', 
npm ERR! errno: -4048, 
npm ERR! code: 'EPERM', 
npm ERR! syscall: 'rmdir', 
npm ERR! path: 'D:\\Documents\\js\\socket-io-client\\node_modules\\fsevents\\node_modules' } 
npm ERR! 
npm ERR! Please try running this command again as root/Administrator. 

npm ERR! A complete log of this run can be found in: 
npm ERR!  C:\Users\idf\AppData\Roaming\npm-cache\_logs\2017-08-15T04_50_32_705Z-debug.log 

Aborting installation. 
    npm install --save --save-exact --loglevel error react react-dom react-scripts has failed. 

Deleting generated file... package.json 
Deleting generated file... node_modules 
+0

我相信我明白這個問題。我有另一個節點應用程序運行。當我停止並重新嘗試create-react-app時,它一路順利通過,沒有任何問題。我確實更新了node.js和npm,至少其中一個也是必需的。 – Ivan

回答

0

我知道你解決了你的問題。但萬一別人得到相同的錯誤信息,最終爲我工作的是刪除這些文件夾。

C:\Users\[username]\AppData\Roaming\npm 
C:\Users\[username]\AppData\Roaming\npm-cache 

如果問題仍然存在,嘗試從這個線程的修復程序之一:https://github.com/npm/npm/issues/10826

相關問題