Node.js 同时运行npm
我一直在引用这篇文章: 但是,我的两个应用程序都不是通过Node.js 同时运行npm,node.js,Node.js,我一直在引用这篇文章: 但是,我的两个应用程序都不是通过npm-run-dev启动的。两个应用程序都以代码1退出 My package.json: "scripts": { "start": "ng serve", "start:lt": "ng serve --configuration=lt", "dev": "concurrently --kil
npm-run-dev
启动的。两个应用程序都以代码1退出
My package.json:
"scripts": {
"start": "ng serve",
"start:lt": "ng serve --configuration=lt",
"dev": "concurrently --kill-others \"npm start\" \"npm start:lt\""
}
是的,我同时安装了。您可以使用模块启动应用程序
首先,您需要Procfile
与命令一起并行执行
start: ng serve
start_lt: ng serve --configuration=lt
其次,将其添加到package.json
"scripts": {
"start":"nf start"
}
第三-在.env
文件中定义端口变量
PORT=4201
最后,您可以通过
npm start
启动您的应用程序-它将启动foreman
可执行文件,同时启动start
和start\lt
组件npm运行start:lt?当然,我怎么没有看到这一点。如何添加端口以运行start:lt?执行npm运行开始:lt-p4201
似乎不起作用可能--p4210
,您通常需要--
指示其他参数指向脚本而不是npm
本身。
start: ng serve
start_lt: ng serve --configuration=lt