[英]Can't run “npm start” in git bash on one computer, but on another I can
我正在使用Electron設計便攜式計算機和台式機上的應用程序。 為了管理兩台不同機器之間的代碼庫,我使用了Git。 在我的筆記本電腦上,我可以在Git Bash中運行npm start
,但是在我的台式機上卻不能。 我想提供的唯一信息(盡管我不知道它是否有用)是我的package.json,它同時存在於兩台機器上:
{
"name": "nbastatsapp",
"version": "0.0.1",
"description": "NBA stats app",
"main": "index.js",
"scripts": {
"start": "electron ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/nbastatsapp/NBAStatsApp.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/nbastatsapp/NBAStatsApp/issues"
},
"homepage": "https://github.com/nbastatsapp/NBAStatsApp#readme",
"devDependencies": {
"electron-prebuilt": "^0.36.7"
}
}
當我在桌面的Git Bash上運行npm start
時,會得到以下信息:
$ npm start
> nbastatsapp@0.0.1 start E:\NBAStatsApp
> electron .
'node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! nbastatsapp@0.0.1 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nbastatsapp@0.0.1 start script 'electron .'.
npm ERR! This is most likely a problem with the nbastatsapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get their info via:
npm ERR! npm owner ls nbastatsapp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\NBAStatsApp\npm-debug.log
為避免大量發布,以下是此錯誤的完整輸出日志鏈接: http : //textuploader.com/525d1
如何在台式機的Git Bash中啟用npm start
?
在計算機上安裝node.js並確保它位於%PATH%
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.