Ton*_*hew 5 mocha.js node.js chai
运行“npm run test”时出现以下错误:
我的package.json如下:
{
"name": "express-app",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"test": "nyc --reporter=lcov mocha ./tests/unitTests --color",
"integrationTest": "mocha ./tests/integrationTests --exit"
},
"dependencies": {
"cookie-parser": "1.4.3",
"cors": "^2.8.5",
"debug": "2.6.9",
"ejs": "2.5.9",
"express": "4.16.3",
"express-mung": "0.5.1",
"express-validation": "^3.0.2",
"http-errors": "1.6.3",
"mongoose": "^5.9.7",
"prom-client": "11.3.0",
"swagger-ui-express": "4.0.4"
},
"devDependencies": {
"chai": "4.2.0",
"chai-http": "4.3.0",
"mocha": "6.1.4",
"nyc": "14.1.1"
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下命令全局安装摩卡:
npm i -g mocha
Run Code Online (Sandbox Code Playgroud)
即使之后我也遇到了上述相同的错误。谁能告诉我我做错了什么吗?
更新:
我的机器位于公司代理后面