我从这里下载了Angular Quick start项目:https://angular.io/docs/ts/latest/guide/setup.html。该示例将无法在我的linux机器上启动。 node.js和npm根据README.md文件处于指定的版本级别。我将node.js安装在本地主目录中并将其添加到我的路径中。我已经运行了几次npm安装并得到了相同的结果。作为旁注,我能够在我的MAC上安装并运行快速启动项目。
这是输出:
npm start
> angular-quickstart@1.0.0 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! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 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
好的,所以我运行了建议的命令:npm i tsc lite-server我现在收到此错误:
npm start
> angular-quickstart@1.0.0 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! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 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 :(得分:0)
您没有安装tsc
和lite-server
,它们不会出现在package.json中的依赖项下。
运行
npm i tsc lite-server
然后再次启动应用
答案 1 :(得分: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。