vue的錯誤的ERR!代碼ELIFECYCLE


錯誤的ERR!代碼ELIFECYCLE

寶慕林4294392 2019-08-31 14:40:35

我正在嘗試學習反應,所以我有這個示例代碼為fullstack反應投票應用程序,我試圖讓它工作,但在運行npm install后跟npm start我收到以下錯誤:

 

npm ERR! Darwin 16.4.0

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server"

npm ERR! node v7.5.0

npm ERR! npm  v4.3.0

npm ERR! file sh

npm ERR! code ELIFECYCLE

npm ERR! errno ENOENT

npm ERR! syscall spawn

npm ERR! voting_app@1.1.0 server: `live-server --public --    

host=localhost --port=3000 --middleware=./disable-browser-cache.js`

npm ERR! spawn ENOENT

npm ERR!

npm ERR! Failed at the voting_app@1.1.0 server script 'live-server --

public --host=localhost --port=3000 --middleware=./disable-browser- 

cache.js'.

npm ERR! Make sure you have the latest version of node.js and npm  

installed.

npm ERR! If you do, this is most likely a problem with the voting_app  

package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     live-server --public --host=localhost --port=3000 --  

middleware=./disable-browser-cache.js

npm ERR! You can get information on how to open an issue for this  

project with:

npm ERR!     npm bugs voting_app

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls voting_app

npm ERR! There is likely additional logging output above.

 

npm ERR! Please include the following file with any support request:

npm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_581Z-

debug.log

 

npm ERR! Darwin 16.4.0

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"

npm ERR! node v7.5.0

npm ERR! npm  v4.3.0

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! voting_app@1.1.0 start: `npm run server`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the voting_app@1.1.0 start script 'npm run server'.

npm ERR! Make sure you have the latest version of node.js and npm 

installed.

npm ERR! If you do, this is most likely a problem with the voting_app    

package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     npm run server

3 回答

?
偶然的你

 

步驟1: $ npm cache clean --force

步驟2:按文件夾刪除node_modules$ rm -rf node_modules或通過進入目錄手動刪除它,然后右鍵單擊>刪除。也刪除package-lock.json文件。

第3步: npm install

重新開始 $ npm start

這對我有用。希望它也適合你。

PS:如果它在那里,請檢查它以紅色顯示的錯誤並采取相應措施。此錯誤特定於node.js環境。快樂編碼!!

 

 反對2019-08-31
 
?
慕田峪7331174

清潔CacheNode_module不夠。請遵循以下步驟:

  • npm cache clean --force

  • 刪除node_modules文件夾

  • 刪除package-lock.json文件

  • npm install

它對我有用。

 

 反對2019-08-31
 
?
慕桂英3389331

我先跑了:

 

npm run clean

(即使它有錯誤)

 

然后我刪除了node_modules文件夾並運行

 

npm install

這似乎解決了這個問題。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM