1

npm 版本是 4.6.1 也可以参考github 链接

我创建了一个普通的 hello world 应用程序并尝试了

create-react-native-app HelloWorldVatsal

它创建了应用程序并加载了所有模块等,并在终端上给出了成功消息

之后做了如下

cd HelloWorldVatsal
npm start

HelloWorldVatsal@0.1.0 start /home/mvix-vatsal/HelloWorldVatsal
react-native-scripts start

14:52:58: Unable to start server
  See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
    sudo sysctl -w fs.inotify.max_user_instances=1024
    sudo sysctl -w fs.inotify.max_user_watches=12288
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! HelloWorldVatsal@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the HelloWorldVatsal@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mvix-vatsal/.npm/_logs/2018-02-19T09_22_58_504Z-debug.log
4

3 回答 3

3

正如您从下面显示的错误消息行中看到的那样;

See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
    sudo sysctl -w fs.inotify.max_user_instances=1024
    sudo sysctl -w fs.inotify.max_user_watches=12288

您需要安装watchman或运行错误消息中显示的代码段。

于 2018-02-20T08:56:22.813 回答
1

只是安装watchman对我有用:D

我的系统(mac)-> OSX 10.12.3

brew update

brew install watchman
于 2018-06-01T19:02:16.100 回答
0

在mac上运行以下对我有用:

sudo sysctl -w kern.maxfiles=5242880

sudo sysctl -w kern.maxfilesperproc=524288

于 2018-08-07T07:08:01.010 回答