【发布时间】:2018-05-04 07:45:32
【问题描述】:
所有这些包是如何安装到 process.env 中的,为什么我在 npm 脚本中没有看到 NODE_ENV 设置?
"start": "NODE_ENV=dev npm run build && npm run watch && npm run tslint"
我的 npm 脚本:
"scripts": {
"start": "npm run build && npm run watch && npm run tslint",
"build": "npm run build-ts",
"serve": "nodemon dist/Server.js",
"watch": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-ts\" \"npm run serve\"",
"test": "mocha --compilers ts:ts-node/register",
"build-ts": "tsc",
"watch-ts": "tsc -w",
"tslint": "tslint -c tslint.json -p tsconfig.json",
"debug": "npm run build && npm run watch-debug",
"serve-debug": "nodemon --inspect dist/Server.js",
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-ts\" \"npm run serve-debug\""
},
【问题讨论】:
-
npm install 可能吗?还有你的配置文件是什么样的?
标签: typescript npm typescript-typings npm-scripts