[英]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.