'.'不被识别为内部或外部命令

时间:2021-06-08 12:38:14

标签: node.js command-line rake

几周前,rake 突然无法识别相对路径,并不断给我错误消息:

'.' is not recognized as an internal or external command

这是它发生的地方之一:

> chipmunk.client@1.0.0 prod
> ./node_modules/.bin/ng build --prod --aot --outputHashing=all

'.' is not recognized as an internal or external command,
operable program or batch file.
rake aborted!

package.json 文件中,我从那里获取命令,它被写为:

"prod": "./node_modules/.bin/ng build --prod --aot --outputHashing=all"

只要我删除路径并只写 ng,它就会起作用:

"prod": "ng build --prod --aot --outputHashing=all"

我现在的问题是:如何在不更改删除路径的情况下解决此问题?

到目前为止我尝试过的:

  • 删除路径(有效 - 但想避免)
  • 使用不同的命令行(cmd.exepowershellgit shell)(没有帮助)
  • 重新安装 rakenodeJS 和我使用的所有其他东西(没有帮助)
  • 重新启动 Visual Studio Code(没有帮助)
  • 更新 Visual Studio Code(没有帮助)
  • 更新我的电脑(没有帮助)
  • 重新启动我的电脑(没有帮助)

我也在 '.' is not recognized as an internal or external command, 中看到了一个非常相似的问题,但他们建议在 package.json 文件中删除路径或更改其他内容,如果可能,我想避免这样做。

我正在使用 Windows 10(以防万一)。 在其他装有 Windows 10 的 PC 和我的 Ubuntu VM 上,它运行良好,没有任何问题,只是在那台 PC 上出现此错误。

0 个答案:

没有答案