Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 同时运行npm_Node.js - Fatal编程技术网

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