未安装React

问题描述

我正在尝试通过npm安装react,但是它给了我这个错误

error An unexpected error occurred: "EPERM: operation not permitted,copyfile 'C:\\Users\\Bilal\\AppData\\Local\\Yarn\\Cache\\v6\\npm-request-2.88.2-d73c918731cb5a87da047e207234146f664d12b3-integrity\\node_modules\\request\\lib\\cookies.js' -> 'G:\\my-react\\node_modules\\request\\lib\\cookies.js'".

我已经使用了无数命令

解决方法

我遇到了同样的问题,我所做的是改用这个命令,这样它就不会从本地缓存中复制文件

create-react-app your_app_name --use-npm --cache /tmp/empty-cache 
,

可能的解决方案:

1. Download latest recommended version of NodeJS
2. Uninstall current version from Control Panel
3. Go to C:\Users\{YourUsername}\AppData\Roaming folder and delete npm and npm-cache folders
4. Run installer of NodeJS
5. Update NPM to latest with npm i -g npm@latest command line
,

我将目录从C更改为另一个目录,并且该目录有效。也许问题在于在根驱动器中安装软件包。

,

我之前遇到了一些问题,所以我尝试了一下,然后开始工作,

如果您使用avast!防病毒或其他防病毒软件,您必须先禁用create-react-app

,

您的 PC 上是否启用了防病毒软件?如果是这样,请尝试禁用它并重试命令 npx create-react-app my-app

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...