angular2快速启动而不使用lite-server

时间:2016-04-12 21:31:48

标签: angularjs

我的快速启动在默认安装下运行良好。

但是,我不想使用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服务器。

2 个答案:

答案 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\" "

。{