2017-07-05 88 views
1

这是我第一次尝试学习反应,它开始非常糟糕。我已经完成了“创建新应用”选项卡上的指示:https://facebook.github.io/react/docs/installation.html。没有做任何不同的事情。reactjs npm start ELIFECYCLE错误

我使用节点8.1.3和5.0.4 NPM

(我也尝试降级节点至6.11没有成功)。

我在安装过程中根本没有任何错误。

当我运行npm start,我得到这个超级无益的错误:

Starting the development server... 

events.js:182 
    throw er; // Unhandled 'error' event 
^

Error: watch /var/phil-machine/Code/react/test1/public ENOSPC 
at exports._errnoException (util.js:1022:11) 
at FSWatcher.start (fs.js:1384:19) 
at Object.fs.watch (fs.js:1410:11) 
at createFsWatchInstance (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:37:15) 
at setFsWatchListener (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:80:15) 
at FSWatcher.NodeFsHandler._watchWithNodeFs (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:228:14) 
at FSWatcher.NodeFsHandler._handleDir (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:407:19) 
at FSWatcher.<anonymous> (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:455:19) 
at FSWatcher.<anonymous> (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:460:16) 
at FSReqWrap.oncomplete (fs.js:153:5) 
npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] start: `react-scripts start` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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/phil/.npm/_logs/2017-07-05T23_52_25_652Z-debug.log 

我不知所措。我GOOGLE了它(尽我所能 - 我甚至不知道什么谷歌除了通用的“反应开始错误”),并得到了这个答案https://stackoverflow.com/a/39960890/1569591但这也没有帮助。

当我运行npm start它带来了上述错误,并打开“Site can not be reached”错误的bowser。

任何人都可以帮助指出我如何解决这个问题吗?

我也试图改变启动命令来使用不同的端口:

PORT=3001 react-scripts start 

也不能工作。

回答

1

看起来像节点的问题,ENOSPC意味着驱动器上没有空间。

也许/ tmp已满?您可以通过设置npm config set tmp/path/to/some/other/dir来配置npm以使用不同的临时文件夹,或者可以从/ tmp文件夹中删除所有内容。

来源:ENOSPC在npm的github中的回购。

+0

/tmp只有2.7MB大:( –

+1

我有同样的不可理解的错误,这个答案让我走上正轨,问题已经用3个命令行解决了:'sudo apt-get autoremove','sudo rm -rf/tmp/*'然后'sudo reboot'。现在一切都适合我! – mrroboaat

0

我不完全确定是否这是问题,但我已经得到它的工作。

事实证明,另一项服务,格拉法纳正在使用本地主机端口3000.我删除了格拉法纳,它仍然失败。重新启动后,它似乎工作。

再一次,我不确定这是否会解决它100%,如果别人有同样的问题,但这是为我解决了它。

0

我不知道您正在使用哪种操作系统,但如果您使用的是Fedora或CentOS,请尝试禁用selinux。 我有类似的问题,但禁用selinux后,它开始工作完美。

相关问题