在使用 Typescript 构建的节点项目中无法 运行 Nodemon(在 Windows 中)
Can not run Nodemon in node project build with Typescript (In Windows)
Node 项目是用 Typescript 构建的,package.json 文件中有三个脚本但是当我 运行 它显示 ...
如果我 运行 这个项目在 ubuntu 它工作正常但在 windows
Image of output terminal
但是在这个 nodemon 之后没有开始 运行 项目。
Package.json
中的脚本
"start": "tsc --watch & nodemon dist/index.js",
"lint": "tslint -c tslint.json 'src/**/*.ts' --fix",
"build": "tsc"
帮我解决这个问题,先谢谢你:)
您似乎在 tsc --watch
和 nodemon dist/index.js
之间缺少一个 &
字符。单个 &
不是有效的 and
运算符:
"start": "tsc --watch && nodemon dist/index.js",
更新 看来问题出在 Windows。通常这个问题是通过使用诸如 concurrently 或 cross-env 之类的库以类似的方式在 Windows 上执行命令来解决的。同时安装后:
"start": "concurrently \"tsc --watch\" \"nodemon dist/index.js\"",
希望对您有所帮助!
Node 项目是用 Typescript 构建的,package.json 文件中有三个脚本但是当我 运行 它显示 ...
如果我 运行 这个项目在 ubuntu 它工作正常但在 windows
Image of output terminal
但是在这个 nodemon 之后没有开始 运行 项目。
Package.json
中的脚本"start": "tsc --watch & nodemon dist/index.js",
"lint": "tslint -c tslint.json 'src/**/*.ts' --fix",
"build": "tsc"
帮我解决这个问题,先谢谢你:)
您似乎在 tsc --watch
和 nodemon dist/index.js
之间缺少一个 &
字符。单个 &
不是有效的 and
运算符:
"start": "tsc --watch && nodemon dist/index.js",
更新 看来问题出在 Windows。通常这个问题是通过使用诸如 concurrently 或 cross-env 之类的库以类似的方式在 Windows 上执行命令来解决的。同时安装后:
"start": "concurrently \"tsc --watch\" \"nodemon dist/index.js\"",
希望对您有所帮助!