【问题标题】:React is not getting installedReact 没有安装
【发布时间】:2020-08-12 20:15:20
【问题描述】:

我正在尝试通过 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'".

我用了很多命令都没用

【问题讨论】:

标签: javascript reactjs npm npm-install


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    可能的解决方案:

    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
    

    【讨论】:

    • 尝试回滚到节点版本 5
    【解决方案3】:

    我将目录从C 更改为另一个目录,它工作正常。也许问题在于在根驱动器中安装软件包。

    【讨论】:

      【解决方案4】:

      我之前遇到了一些问题,所以我尝试了这个并开始工作,

      如果你使用 avast!杀毒软件或其他杀毒软件,您必须在 create-react-app 之前禁用

      【讨论】:

        【解决方案5】:

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

        【讨论】:

        • 已有另一个答案建议禁用防病毒软件,无需添加另一个。谢谢。
        猜你喜欢
        • 2022-07-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-06-05
        • 1970-01-01
        • 1970-01-01
        • 2021-04-04
        • 2020-12-05
        相关资源
        最近更新 更多