“npm运行覆盖”不与摩卡一起运行

我正尝试在express.js应用程序上使用摩卡来运行伊斯坦布尔

每次运行cmd npm run coverage时,我都会在cmd中得到这个错误:

Unable to resolve file [node_modules/mocha/bin/_mocha] Try "istanbul help" for usage npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! dabl-demo@1.0.0 coverage: `istanbul cover node_modules/mocha/bin/_mocha` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dabl-demo@1.0.0 coverage script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\donallane\AppData\Roaming\npm-cache\_logs\2017-11-10T11_55_29_922Z-debug.log 

我已经更新了最新版本的npm ..重新运行cmd npm install ..卸载并重新安装node_modules目录。

cmd npm运行覆盖仍然不会创build一个覆盖文件夹,并填充所有我的项目文件..

任何帮助将是伟大的..这是我的package.json文件:

 { "name": "dabl-demo", "version": "1.0.0", "main": "app.js", "scripts": { "test": "mocha", "coverage": "istanbul cover node_modules/mocha/bin/_mocha", "showcoverage": "start coverage/lcov-report/index.html" }, "dependencies": { "body-parser": "^1.18.2", "connect": "^3.6.5", "consolidate": "^0.15.0", "dateformat": "^3.0.2", "express": "^4.16.2", "method-override": "^2.3.10", "morgan": "^1.9.0", "mysql": "^2.15.0", "mysql2": "^1.4.2", "nodemon": "^1.12.1", "nunjucks": "^3.0.1", "path": "^0.12.7", "pg": "^7.4.0", "pg-hstore": "^2.3.2", "request": "^2.83.0", "sequelize": "^4.22.5", "sequelize-cli": "^3.0.0", "sqlite3": "^3.1.13" }, "author": "", "license": "ISC", "devDependencies": { "chai": "^4.1.2", "chai-http": "^3.0.0", "istanbul": "^0.4.5", "mocha": "^2.4.5", "nodemon": "^1.12.1", "request": "^2.83.0" } }