Microsoft Windows [版本 10.0.17763.652]
(c) 2018 Microsoft Corporation。保留所有权利。

C:\Users\sam>npm install -g react
+ react@16.9.0
added 5 packages and updated 1 package in 46.018s

C:\Users\sam>npm install -g create-react-app
C:\Users\sam\AppData\Roaming\npm\create-react-app -> C:\Users\sam\AppData\Roaming\npm\node_modules\create-react-app\index.js
+ create-react-app@3.1.1
updated 1 package in 29.647s

C:\Users\sam>create-react-app my-app

Creating a new React app in C:\Users\sam\my-app.

You are using Node v8.9.4 so the project will be bootstrapped with an old unsupported version of tools.

Please update to Node 8.10 or higher for a better, fully supported experience.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.17.3
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "%27https://registry.npm.taobao.org%27/react: Invalid URI \"%27https://registry.npm.taobao.org%27/react\"".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\sam\\my-app\\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@0.9.x --cwd C:\Users\sam\my-app has failed.

Deleting generated file... package.json
Done.

C:\Users\sam>npm config set registry https://registry.npmjs.org/

C:\Users\sam>create-react-app my-app

Creating a new React app in C:\Users\sam\my-app.

You are using Node v8.9.4 so the project will be bootstrapped with an old unsupported version of tools.

Please update to Node 8.10 or higher for a better, fully supported experience.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.17.3
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
warning react-scripts > extract-text-webpack-plugin@1.0.1: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
warning react-scripts > fsevents@1.0.17: Way too old
warning react-scripts > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning react-scripts > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
info There appears to be trouble with your network connection. Retrying...
warning react-scripts > babel-preset-react-app > babel-preset-env > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning react-scripts > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
info There appears to be trouble with your network connection. Retrying...
warning react-scripts > fsevents > node-pre-gyp > hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning react-scripts > fsevents > node-pre-gyp > request > hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning react-scripts > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
warning react-scripts > fsevents > node-pre-gyp > hawk > hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > fsevents > node-pre-gyp > hawk > sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning react-scripts > fsevents > node-pre-gyp > hawk > sntp > hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > fsevents > node-pre-gyp > hawk > boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > fsevents > node-pre-gyp > hawk > boom > hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > fsevents > node-pre-gyp > hawk > cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > fsevents > node-pre-gyp > hawk > cryptiles > boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > css-loader > cssnano > postcss-merge-rules > postcss-selector-parser > flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
warning react-scripts > eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz: getaddrinfo EAI_AGAIN registry.npmjs.org:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\sam\\my-app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
info There appears to be trouble with your network connection. Retrying...

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts@0.9.x --cwd C:\Users\sam\my-app has failed.

Deleting generated file... package.json
Done.

C:\Users\sam>

 

 

说明:因之前设置了npm的注册URL为淘宝的,所以有这个错误。现还原为 https://registry.npmjs.org/,问题解决。命令:npm config set registry https://registry.npmjs.org/

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐