使用npx create-react-app my-app
时出错。我是node
和react
的新手,我正在尝试创建我的第一个react应用程序。我似乎有相当好的互联网连接。
我尝试了npx create-react-app my-app
6次,但它有相同的错误:
user@Acer:~/ReactProjects$ npx create-react-app my-app
Creating a new React app in /home/user/ReactProjects/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ETIMEDOUT
npm ERR! syscall read
npm ERR! errno ETIMEDOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/@babel%2fplugin-proposal-async-generator-functions: read ETIMEDOUT
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2022-03-06T11_34_36_543Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from /home/user/ReactProjects
Done.
user@Acer:~/ReactProjects$
字符串
我在windows 10
build 19044
上使用vscode
和remote wsl extension
运行此程序,remote wsl extension
连接到wsl2
上的ubuntu-20.04
。我想创建我的第一个react app
。我应该从这里做什么?
3条答案
按热度按时间v9tzhpje1#
有时我得到同样的错误时,没有连接网络或网络连接不良。
44u64gxh2#
尝试使用npm install -g npm@latest --force更新npm
oalqel3c3#
我有同样的问题,这个错误发生,因为你正在使用代理服务器连接互联网,如果这样停止使用代理将解决它,但如果你想跟上代理遵循这第一个清除缓存
字符串
第二:
型
第三:
型
上一页:
型