【问题标题】:npm run start with "DEBUG=*" issue on Windowsnpm run start 在 Windows 上出现“DEBUG=*”问题
【发布时间】:2017-08-14 11:22:22
【问题描述】:

{
  "name": "apokidsi",
  "version": "0.717",
  "contributors": [
  ],
  "dependencies": {
    "angular": "1.5.8",
    "angular-cookies": "1.5.8",
    "angular-messages": "1.5.8",
    "angular-ui-router": "1.0.0-beta.3",
    "debug": "^3.0.0",
    "flag-icon-css": "2.8.0",
    "jquery": "3.2.1",
    "moment": "2.18.1",
    "moment-timezone": "0.5.13",
    "node-fetch-npm": "^2.0.1"
  },
  "scripts": {
    "clean": "gulp clean",
    "start": "DEBUG=true HOST=localhost:4200 gulp server",
}
}

这是 package.json 文件。
当我运行 npm run start
我收到此消息
'DEBUG' 未被识别为内部或外部命令, 可运行的程序或批处理文件。
npm 错误!代码生命周期
npm 错误!错误号 1

【问题讨论】:

  • npm run start 基本上运行您的启动命令。意思是,它与在终端中运行DEBUG=true HOST=localhost:4200 gulp server 命令相同。
  • 但我不明白DEBUG和HOST参数。
  • windows 如何知道 DEBUG 和 HOST 是 npm 中的识别命令。我试过 SET DEBUG=* 但它没有用。

标签: node.js debugging npm


【解决方案1】:

在检查了我们必须使用跨环境依赖项的所有可能性之后。

所以安装 npm install cross-env --save-dev

在 package.json 中

“开始”:“cross-env-shell DEBUG=True HOST=dev.example.com gulp server”

【讨论】:

    猜你喜欢
    • 2018-04-11
    • 2022-10-14
    • 1970-01-01
    • 2018-07-16
    • 1970-01-01
    • 2018-12-23
    • 2017-06-15
    • 2017-01-18
    • 2021-07-04
    相关资源
    最近更新 更多