无法将nodemon"mocha"识别为内部或外部命令,可操作程序或批处理文件 [英] nodemon ''mocha' is not recognized as an internal or external command, operable program or batch file

查看:767
本文介绍了无法将nodemon"mocha"识别为内部或外部命令,可操作程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为Windows 10上的nodejs项目运行测试 package.json中的行为:

Running a test for a nodejs project on windows 10 with the line in package.json as:

"test": "nodemon --exec 'mocha -R min'"

我得到:

>  nodemon --exec 'mocha -R min'  

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `'mocha -R min'`
''mocha' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...
rs
[nodemon] starting `'mocha -R min'`
''mocha' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...

推荐答案

在以下代码中效果很好:

That worked fine with the line:

"test": "nodemon --exec \"mocha -R min\""

在package.json中

in package.json

这篇关于无法将nodemon"mocha"识别为内部或外部命令,可操作程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆