我的快速启动在默认安装下运行良好。
但是,我不想使用lite-server,因为我已经安装了node.js.
是否有更改package.json命令以启动节点而不是lite-server?
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"docker-build": "docker build -t ng2-quickstart .",
"docker": "npm run docker-build && docker run -it --rm -p 3000:3000 -p 3001:3001 ng2-quickstart",
"postinstall": "typings install"
},
我改变了
"lite": "lite-server",
到
"lite": "node",
节点启动时没有错误。但是当我尝试使用localhost:3000时,浏览器提供了#34;无法连接"。任何的想法? 我也想从node_modules下删除lite服务器。
答案 0 :(得分:4)
确定。
"start": "tsc && concurrently \"npm run tsc:w\" \"node your/folder/app.js\" ",
答案 1 :(得分:0)
在package.json
中,替换
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" "
与"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "