简体   繁体   English

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

[英]React Error: EPERM: operation not permitted

I am learning react and trying to create react app from command line in windows 10. But it gives an error in middle of the process.我正在学习反应并尝试从 Windows 10 中的命令行创建反应应用程序。但它在过程中间出现错误。 Below is the error log.下面是错误日志。

My node version is v10.8.0 and npm version is 6.2.0我的节点版本是 v10.8.0,npm 版本是 6.2.0

I am using below command to create the app.我正在使用以下命令来创建应用程序。

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).

I had exactly the same problem. 我有完全一样的问题。 I simply turned off my Windows Defender Real-time protection and ran the create-react-app command again, then the problem has been solved. 我只是关闭了Windows Defender实时保护,然后再次运行create-react-app命令,然后问题就解决了。

Try deleting all text files on npm-cache logs folder.尝试删除 npm-cache 日志文件夹中的所有文本文件。 It worked for me.它对我有用。

C:\\Users\\ yours \\AppData\\Local\\npm-cache\\_logs C:\\Users\\的 \\AppData\\Local\\npm-cache\\_logs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:EPERM:不允许操作,mkdir - Error: EPERM : Operation not permitted,mkdir 错误:EPERM:不允许操作,重命名 - Error: EPERM: operation not permitted, rename 反应本机应用程序; 启动打包程序时出错:错误:EPERM:不允许操作 - React Native application; Error starting packager: Error: EPERM: operation not permitted 遇到 WebStorm 问题,错误:EPERM:不允许操作 - Having trouble with WebStorm, ERROR: EPERM: operation not permitted Next JS:错误:EPERM:不允许操作,rmdir - Next JS : Error: EPERM: operation not permitted, rmdir 下一个 JS:错误:EPERM:不允许操作,打开 - Next JS : Error: EPERM: operation not permitted, open 错误:EPERM:不允许操作,安装 create-react-app 时 mkdir 'C:\Users\...'' - Error: EPERM: operation not permitted, mkdir 'C:\Users\…'' when installing create-react-app 我正在尝试安装 React,但我一直收到“错误:EPERM:不允许操作” - I'm trying to install react but I keep getting an 'Error: EPERM: operation not permitted' npm - EPERM:Linux 不允许操作 - npm - EPERM: operation not permitted on Linux 为什么我收到此错误 - 错误:EPERM:不允许操作,找不到 mkdir 'C:\Users\Aniket' 命令:create-react-app - Why I am getting this error - Error: EPERM: operation not permitted, mkdir 'C:\Users\Aniket' command not found: create-react-app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM