在Windows中的'init'新项目中反应本机抛出错误

时间:2016-06-10 13:24:46

标签: node.js reactjs react-native

我已粘贴在npm-debog.log文件的一部分下面。在按照本地官方网站的反应开始guid的指示后,我做了反应原生的init AwesomeProject。很长一段时间命令提示符只是挂起然后它抛出以下错误。我有节点v.4.4.5,npm v2.13.0,react-native-cli v1.0.0。

This will walk you through creating a new React Native project in D:\Mobile_app_
dev_workspace\AwesomeProject
Installing react-native package from npm...

npm WARN peerDependencies The peer dependency react@15.1.0 included from react-n
ative will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerD
ependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it
explicitly.
npm ERR! fetch failed https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-1.0.0
.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 103.2
45.222.162:443
npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.38.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 103.2
45.222.162:443
npm WARN optional dep failed, continuing utf-8-validate@1.2.x
npm ERR! fetch failed https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 103.2
45.222.162:443
npm ERR! fetch failed https://registry.npmjs.org/cookie-parser/-/cookie-parser-1
.3.5.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 103.2
45.222.162:443
npm WARN optional dep failed, continuing fsevents@1.0.12
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ronald\\AppData\
\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-ex
act" "react-native"
npm ERR! node v4.4.5
npm ERR! npm  v2.13.0
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 103.245.222.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
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! Please include the following file with any support request:
npm ERR!     D:\Mobile_app_dev_workspace\AwesomeProject\npm-debug.log

`npm install --save --save-exact react-native` failed

1 个答案:

答案 0 :(得分:0)

在Windows上使用react-native的旧版npm存在问题。尝试运行npm upgrade npm@latest,然后重新运行命令。