【发布时间】:2018-12-13 22:43:14
【问题描述】:
我正在尝试使用以下命令安装 jest
npm i jest --save-dev
我收到以下错误
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "i" "jest" "--save-dev"
npm ERR! node v8.11.3
npm ERR! npm v5.6.0
npm ERR! Class constructor cannot be invoked without 'new'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
知道可能是什么问题吗?
【问题讨论】:
-
节点版本是多少?
-
节点 v8.11.3 npm v5.6.0
-
我刚刚运行了安装命令,它工作了。
+ jest@23.6.0 added 557 packages from 341 contributors and audited 17606 packages in 148.343s found 0 vulnerabilities -
你能发布你的 package.json 吗?
-
{ "name": "unit-testing-functions", "version": "1.0.0", "description": "", "main": "index.js", "scripts ": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC" }