npm错误!错误:EPERM:不允许操作

npm错误!错误:EPERM:不允许操作,npm,create-react-app,Npm,Create React App,以管理员身份从Windows Powershell运行,我已尝试了以下所有方法。什么都不管用。不仅如此,还需要20分钟才能找到错误 升级节点 升级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 p

以管理员身份从Windows Powershell运行,我已尝试了以下所有方法。什么都不管用。不仅如此,还需要20分钟才能找到错误

  • 升级节点
  • 升级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...


> uglifyjs-webpack-plugin@0.4.6 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

我知道你已经解决了你的问题。但如果其他人收到了相同的错误消息,那么最终对我起作用的就是删除这些文件夹

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

如果问题仍然存在,请尝试此线程中的一个修复程序:。

我相信我理解问题所在。我运行了另一个节点应用程序。当我停止并重试CreateReact应用程序时,它一路顺利通过。我确实更新了node.js和npm Think,其中至少有一个是必要的。