首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >react-native项目创建给出node-pre-gyp命中错误套接字挂起错误

react-native项目创建给出node-pre-gyp命中错误套接字挂起错误
EN

Stack Overflow用户
提问于 2019-02-26 09:39:03
回答 1查看 171关注 0票数 0

我正在尝试创建一个react-native项目,然而,它在安装node-pre-gyp模块时抛出错误。

我使用的是Mac,我也尝试在全球范围内安装node-pre-gyp。然而,得到了相同的错误。

代码语言:javascript
复制
➜  mobile react-native init Demo
This will walk you through creating a new React Native project in /Users/gaurang.shah/Documents/personal/code/mobile/Demo
Installing react-native...
Consider installing yarn to make this faster: https://yarnpkg.com

> fsevents@1.2.7 install /Users/gaurang.shah/Documents/personal/code/mobile/Demo/node_modules/fsevents
> node install

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@11.10.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error socket hang up
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  COPY /Users/gaurang.shah/Documents/personal/code/mobile/Demo/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN react-native@0.58.5 requires a peer of react@16.6.3 but none is installed. You must install peer dependencies yourself.

+ react-native@0.58.5
added 733 packages from 381 contributors and audited 27744 packages in 899.043s
found 11 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
EN

回答 1

Stack Overflow用户

发布于 2019-03-07 17:04:46

这可能是由于node_modules中安装的旧软件包与新版本的npm不兼容。尝试使用rm -rf Demo/node_modules删除node_modules目录,然后重试mobile react-native init Demo

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54877245

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档