角度快速启动不会启动
问题描述:
我从这里下载了角度快速启动项目: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
答
你不必tsc
和lite-server
已安装,并且它们不显示在package.json的依赖项下。
运行
npm i tsc lite-server
然后启动应用程序再次
答
尝试在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。