【问题标题】:'..' is not recognized as an internal or external command, operable program or batch file'..' 不是内部或外部命令、可运行程序或批处理文件
【发布时间】:2020-12-15 19:13:23
【问题描述】:

当我在 windows10 中使用 npm run build 时,我遇到了这个错误 我的 package.json 是这样的

    {
  "name": "ng-matero",
  "version": "10.3.0",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/ng-matero/ng-matero/issues"
  },
  "homepage": "https://ng-matero.github.io/ng-matero/",
  "scripts": {
    "build": "../node_modules/.bin/tsc -p tsconfig.json"
  },
  "schematics": "./collection.json",
  "sideEffects": false
}

【问题讨论】:

  • 这个 package.json 是一个子文件,期望使用父目录的 node_modules/.bin

标签: windows npm


【解决方案1】:

npm run 会自动检查父级node_modules 目录,因此您可以删除package.json 文件中的..。

        "build": "tsc -p tsconfig.json"

上面会找到安装在../node_modules中的tsc,除非node_modules中安装了tsc。

【讨论】:

    猜你喜欢
    • 2018-08-25
    • 2014-06-01
    • 2022-01-06
    • 2016-07-07
    • 2021-12-20
    • 2016-12-03
    • 2019-04-25
    • 2015-05-16
    • 2019-09-16
    相关资源
    最近更新 更多