Reactjs 反应错误:EPERM:不允许操作

Reactjs 反应错误:EPERM:不允许操作,reactjs,npm,cmd,Reactjs,Npm,Cmd,我正在学习react,并尝试在windows 10中从命令行创建react应用程序。但它在过程的中间给出了一个错误。下面是错误日志 我的节点版本是v10.8.0,npm版本是6.2.0 我正在使用下面的命令创建应用程序 D:\react>create-react-app myappreact Creating a new React app in D:\react\myappreact. Installing packages. This might take a couple of

我正在学习react,并尝试在windows 10中从命令行创建react应用程序。但它在过程的中间给出了一个错误。下面是错误日志

我的节点版本是v10.8.0,npm版本是6.2.0

我正在使用下面的命令创建应用程序

D:\react>create-react-app myappreact

Creating a new React app in D:\react\myappreact.

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

npm ERR! path D:\react\myappreact\node_modules\.staging\url-parse-6c16a96d\index.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\react\myappreact\node_modules\.staging\url-parse-6c16a96d\index.js'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'D:\react\myappreact\node_modules\.staging\url-parse-6c16a96d\index.js']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'D:\react\myappreact\node_modules\.staging\url-parse-6c16a96d\index.js'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path:
npm ERR!       'D:\\react\\myappreact\\node_modules\\.staging\\url-parse-6c16a96d\\index.js' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'D:\\react\\myappreact\\node_modules\\.staging\\url-parse-6c16a96d\\index.js\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'D:\\react\\myappreact\\node_modules\\.staging\\url-parse-6c16a96d\\index.js',
npm ERR!   parent: 'myappreact' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

我也有同样的问题。我只需关闭Windows Defender实时保护并再次运行create react app命令,问题就解决了。

您正在使用哪个版本的node和npm访问此线程。它有一个解决方案,如果您使用5.4,您需要将npm降级到5.3。检查这个thread@Think-两次我的节点版本是v10.8.0,npm是6.2.0。你尝试过github中给出的解决方案吗?@三思而后行,我正在研究这个问题。