簡體   English   中英

NPM ELIFECYCLE 錯誤 - 使用 node server.js 命令

[英]NPM ELIFECYCLE error - using node server.js command

我正在 ibm watson 上部署 test-bot,如下所述https://github.com/eciggaar/text-bot並且當我嘗試使用 CLI 代工廠在本地部署代碼時,出現以下錯誤。

我使用的是 Nodejs 版本 6.10.3 和 npm 版本 5.0.4

有人可以幫我解決這個問題嗎?

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! text-bot@0.1.2 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the text-bot@0.1.2 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!     C:\Users\PRERNA CHUGH\AppData\Roaming\npm-cache\_logs\2017-06-29T13_36_22_995Z-debug.log

有時,當您已經啟動了 Web 服務器時,如果您嘗試在另一個終端 (cmd) 上再次運行npm命令, ELIFECYCLE出現ELIFECYCLE錯誤。 確保您沒有任何其他實例在同一端口中運行。

嘗試使用以下命令清理緩存: npm cache clean with Administrator/root並刪除您的node_modules ,在此步驟之后,嘗試使用npm install --save再次安裝您的軟件包

檢查 package.json 文件中的映射。

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "dependencies": {},
  "scripts": {
    "start": "node ."
  },
  "author": "",
  "license": "ISC"
}

確保 server.js 存在於應用程序目錄中。

如果清除緩存不起作用,這一步可以。 嘗試終止在特定端口(假設為 3000)上運行的進程。 它適用於我的情況。 在您的終端中輸入以下內容,並確保您也在正確的目錄中。

lsof -n -i4TCP:3000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9

祝你好運!!

如果您使用 Windows 操作系統,則 PATH 環境變量不包括“節點”目錄。 檢查它並添加它。 也許它有幫助。

  1. 檢查 echo %PATH%
  2. 然后用 set PATH=%PATH; 添加它
  3. 然后再次嘗試安裝

問候

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM