繁体   English   中英

Windows 10 更新后无法识别 Mocha

[英]Mocha not recognized after windows 10 update

安装最近的 Windows 10 更新后,我无法再运行 mocha。 回滚更新不是一种选择。 这是我得到的错误:

mocha : The term 'mocha' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ mocha .\mascusToCdhTransformationServiceTest.js
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (mocha:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我尝试重新安装我的 npm 应用程序。 我注意到它无法识别我的 python 安装。 我通过运行解决了这个问题

npm install --global --production windows-build-tools

我也尝试了几种变体

npm install mocha
npm install mocha -g
npm uninstall
npm install

一切看似成功,但我仍然收到 Windows 无法识别 mocha 的错误。 我可以做些什么来让 Windows 再次运行 mocha?

我不得不将 ~\\AppData\\Roaming\\npm 添加到我的环境路径变量中。 我不确定为什么它被删除了,但重新添加它解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM