2017-07-05 85 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後,它開始工作完美。

相關問題