【发布时间】:2018-07-06 13:12:16
【问题描述】:
我正在使用 node.js 制作一个 API,并想测试一些文件。 npm init 运行良好并正确安装了软件包,例如 mongoose 和 express。但是,当我运行npm run test-watch 时,终端会抛出以下错误:
[nodemon] 1.14.11
[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...
以下是 package.json 文件的内容:
"scripts": {
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec 'npm test'"
}
节点路径被添加到用户路径中。 init 成功运行并安装了软件包。所以我想知道语法有没有错误。
注意:如果您想检查任何代码,请告诉我
【问题讨论】:
-
不,我试试@UsmanMutawakil
标签: node.js mongodb express node-modules nodemon