【发布时间】:2021-09-15 00:05:17
【问题描述】:
我正在运行 npx create-react-app my-app 并收到以下错误:
Creating a new React app in D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code EEXIST
npm ERR! syscall mkdir
npm ERR! path D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app\node_modules\.staging
npm ERR! errno -4075
npm ERR! EEXIST: file already exists, mkdir 'D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app\node_modules\.staging'
npm ERR! File exists: D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app\node_modules\.staging
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
我试过了:
- 卸载并安装 Node.js
- 更新了 npm 和 npx
- 全局安装 create-react-app,然后再次尝试创建应用
- 试过 npm 缓存清理
请帮忙!
【问题讨论】:
-
您是否按照建议尝试了
npx create-react-app my-app --force?或者使用当前文件夹中尚未使用的名称运行它
标签: node.js reactjs npm node-modules npx