2016-12-16 166 views
1

我從這裏下載了角度快速啓動項目:https://angular.io/docs/ts/latest/guide/setup.html。該示例不會在我的Linux機器上啓動。根據README.md文件,node.js和npm處於指定的版本級別。我將node.js安裝在本地主目錄中,並將其添加到我的路徑中。我已經運行npm install serveral時間並獲得相同的結果。作爲一個便箋,我能夠在我的MAC上安裝並運行快速啓動項目。角度快速啓動不會啓動

下面是輸出:

npm start 

> [email protected] start /home/mydir/quickstart-master 
> tsc && concurrently "tsc -w" "lite-server" 

[0] tsc: Command not found. 
[0] tsc -w exited with code 1 
[1] lite-server: Command not found. 
[1] lite-server exited with code 1 

npm ERR! Linux 2.6.32-642.6.2.el6.x86_64 
npm ERR! argv "/home/mydir/node-v6.9.2-linux-x64/bin/node" "/home/mydir/node-v6.9.2-linux-x64/bin/npm" "start" 
npm ERR! node v6.9.2 
npm ERR! npm v3.10.9 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: `tsc && concurrently "tsc -w" "lite-server" ` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "tsc -w" "lite-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 angular-quickstart package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  tsc && concurrently "tsc -w" "lite-server" 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs angular-quickstart 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls angular-quickstart 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /home/mydir/quickstart-master/npm-debug.log 

OK,所以我跑了建議的命令:NPM我TSC精簡版服務器,我現在收到此錯誤:

npm start 

> [email protected] start /home/mydir/quickstart-master 
> tsc && concurrently "tsc -w" "lite-server" 

error TS5023: Unknown compiler option 'moduleResolution'. 
error TS5023: Unknown compiler option 'lib'. 

npm ERR! Linux 2.6.32-642.6.2.el6.x86_64 
npm ERR! argv "/home/mydir/node-v6.9.2-linux-x64/bin/node" "/home/mydir/node-v6.9.2-linux-x64/bin/npm" "start" 
npm ERR! node v6.9.2 
npm ERR! npm v3.10.9 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: `tsc && concurrently "tsc -w" "lite-server" ` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "tsc -w" "lite-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 angular-quickstart package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  tsc && concurrently "tsc -w" "lite-server" 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs angular-quickstart 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls angular-quickstart 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /home/mydir/quickstart-master/npm-debug.log 

回答

0

你不必tsclite-server已安裝,並且它們不顯示在package.json的依賴項下。

運行

npm i tsc lite-server 

然後啓動應用程序再次

0

嘗試在package.json文件改變了 「開始」 的腳本。

來源:

"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", 

要:

"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 

,然後重新運行npm start

我不知道爲什麼這是必要的,但我也遇到了這個問題。看起來它在4月份因爲某種原因被更換了:diff for package.json