我输入 create-react-app myapp --typescript
然后得到下面的错误提示
google 了一下,什么--timeout=999999,重启机器,设置 npm registry,node 换成 10.0+,检查 ie 设置,也没有设置 proxy,好像都没有用。还是报一样的错误。
请有经验的大神帮忙看一眼。
系统是 windows10
c:\users<username>\.npmrc 里面,指向国内的地址,应该没有问题吧?
registry=https://registry.npm.taobao.org/
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz: connect ETIMEDOUT 104.16.16.35:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\src\\myapp\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template-typescript --cwd C:\src\myapp has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
找到一个 yarn-error.log 文件,主要 信息如下:
Yarn version:
1.22.4
Node version:
8.10.0
Platform:
win32 x64
Trace:
Error: connect ETIMEDOUT 104.16.16.35:443
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
npm manifest:
{
"name": "myapp",
"version": "0.1.0",
"private": true
}
yarn manifest:
No manifest
1
Virace 2020-04-22 11:46:07 +08:00 via Android
yarn config set registry https://registry.npm.taobao.org/
|