ng4中npm start和ng serve--open
2018-02-01 09:24
162 查看
npm start
在命令行中输入npm start后,将会运行package.json文件中scripts里的
start的内容:
如果
start里写的是
ng serve,那么将运行
ng serve;
ng serve –open
在命令行中输入ng serve –open后,ng会找到.angular-cli.json文件中的main所指的
main.ts文件,而main.ts文件加载了根模块
所以如果用的话还是用npm start的吧,我之前用的ng serve –open本来美滋滋,它可以自己打开localhost嘛,后来要跨域访问嘛就加了
ng serve --proxy-config proxy.config.json,就得用npm start来让他走这一句。
其实这种情况下也可以直接在cmd里运行
ng serve --proxy-config proxy.config.json,也能出来跟
npm start一样的效果,但是就统一性来说还是直接运行npm start叭
有错误请大力拍打评论区和私信
相关文章推荐
- npm WARN enoent ENOENT: no such file or directory, open 'D:\web\Imooc\package.json' npm WARN Imooc
- swift mac 使用git, 并使用osc, 打开当前目录命令在终端输入 open . windows 下为start .
- 初始化一个dva+antd的react项目时npm start出错
- 问 npm start 和node ./bin/www有什么区别?
- npm start问题
- OpenLDAP Quick Start Guide
- Start – Modern minimalist OpenCart 2.X 自适应主题模板 ABC
- [转载An open letter to those who want to start programming]
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm start 作用
- Command `start` unrecognized. Make sure that you have run `npm install`
- 使用npm安装vue时报"no such file or directory, open 'xxx\package.json'"的解决方案
- start my life in open source code
- npm start 显示 fetch Metadata: sill map to registry 长时间无响应
- OpenvSwitch + OpenFlow:Let’s get start
- osx openfire stop/start
- JS小知识点三(for gis):openAtStart
- npm 报错:npm ERR! missing script: start npm ERR! A complete log of this run can be found in: npm ERR!
- 关于 “openfiler kernel: iscsi_trgt: scsi_cmnd_start(1045) Unsupported 93” 的报错