本文介绍了不使用lite-server的angular2快速启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的快速入门在默认安装下运行良好.
My quick-start runs fine with default installation .
但是,由于我已经安装了node.js,所以我不想使用lite-server.
however, I don't want to use lite-server since I have already got node.js installed.
是否仍然可以更改package.json命令以启动节点而不是lite-server?
Is there anyway to change the package.json command to start node rather than 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时,浏览器显示无法连接".任何的想法?我也想从node_modules下删除lite服务器.
node started with no error. But when I tried localhost:3000 the browser gave "unable to connect". Any idea?I also want to remove lite server from under node_modules as well.
推荐答案
确定.
"start":"tsc&& \ npm run tsc:w \" \"node your/folder/app.js \",
这篇关于不使用lite-server的angular2快速启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!