简体   繁体   English

在Windows中的“初始化”新项目中反应本机抛出错误

[英]React native throwing errors in 'init' new project in Windows

I have pasted below a part of the npm-debog.log file. 我已经粘贴了npm-debog.log文件的一部分。 After following the instructions from the getting started guid in react native official site, I did react-native init AwesomeProject. 在React Native官方站点中按照入门指南的说明进行操作后,我做了react-native init AwesomeProject。 For a long time the command prompt was just hung and then it threw the following error. 很长一段时间,命令提示符只是挂起,然后引发了以下错误。 I have node v.4.4.5, npm v2.13.0, react-native-cli v1.0.0. 我有节点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

There is a problem with older versions of npm with react-native on Windows. 在Windows上,较早版本的带有react-native的npm存在问题。 Try running npm upgrade npm@latest and then re-run the command. 尝试运行npm upgrade npm@latest ,然后重新运行命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM