运行这个'npm run test
在我的package.json文件中,我编写了这个运行nodemon:
"scripts": {
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec 'npm test'"
},
这个错误在终端显示:
> [email protected] test-watch D:\nodepractice\node-todo-api
> nodemon --exec 'npm test'
[nodemon] 1.12.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `'npm test'`
''npm' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...
如何解决这个问题,我想使用nodemon。
回答如下:而不是单引号,为什么不通过逃避双引号。
试试这个:
"test-watch":"nodemon --exec \"npm test\""