2016-06-10 32 views
0

我粘贴在npm-debog.log文件的一部分下面。按照反应本地官方网站上的入门指导,我做了react-native init AwesomeProject。很长一段时间,命令提示符被挂起,然后抛出以下错误。我有节点v.4.4.5,npm v2.13.0,react-native-cli v1.0.0。在Windows'init'新项目中反应原生抛出错误

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 [email protected] 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 [email protected] 
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 [email protected] 
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 
+0

看起来像一个网络问题。你是否支持代理? –

+0

我不在代理之后。我使用Open DNS。但即使在禁用之后,我仍然看到相同的错误消息。没有运气。我完成了正式文档中提到的所有“入门”步骤。 Python版本是2.7.11。我使用Windows 7 64位计算机。我甚至禁用了防病毒软件的实时保护并尝试了,但没有运气。 – Ronald

回答

0

在Windows上使用react-native时,旧版本的npm存在问题。尝试运行npm upgrade [email protected],然后重新运行该命令。

相关问题