最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

运行这个'npm run test

运维笔记admin7浏览0评论

运行这个'npm run test

运行这个'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\""

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论