【发布时间】:2020-07-16 20:00:53
【问题描述】:
一位朋友与我分享了他正在为 WordPress 开发的主题,我将他的 repo 克隆到我的 /themes 文件夹中,我尝试的第一件事是在主题文件夹中运行“npm install”以获得 gulp 和其他 npm很酷的功能。
这是它返回的内容:
$ npm install
npm ERR! code EINTEGRITY
npm ERR! sha1-fjL3W0e4epHQRhHxvxQQmsAGUdc= integrity checksum failed when using sha1: wanted sha1-fjL3W0e4epHQRhHxvxQQmsAGUdc= but got sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=. (36808 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\rinor\AppData\Roaming\npm-cache\_logs\2020-04-04T17_30_54_859Z-debug.log
在尝试全局安装它后,它给了我同样的错误,所以我想出了从我的电脑上卸载 node.js,然后下载并安装 LTS 版本 (12.16.1)。重新启动,测试,当我尝试输入“node -v”&&“npm -v”时它似乎工作。但是当我回到我的主题并选择“npm install”时,它给了我同样的错误。
这是我的 package.json 内容
{
"name": "ruce-theme",
"version": "1.0.0",
"description": "A starter theme",
"scripts": {
"watch": "gulp watch"
},
"dependencies": {
"bootstrap": "^4.0.0-beta.3",
"jquery": "^3.2.1",
"npm": "^6.4.1",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
"@babel/core": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"babel-core": "^6.25.0",
"babel-loader": "^8.0.5",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.6.0",
"cross-env": "^5.0.1",
"css-loader": "^2.1.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^3.0.1",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0-beta.2",
"gulp-clean-css": "^3.9.1",
"gulp-clone": "^1.1.4",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.2",
"gulp-ignore": "^2.0.2",
"gulp-imagemin": "^4.0.0",
"gulp-merge": "^0.1.1",
"gulp-plumber": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-rimraf": "^0.2.2",
"gulp-sass": "^3.1.0",
"gulp-sequence": "^0.4.6",
"gulp-sourcemaps": "2.6.2",
"gulp-uglify": "^3.0.0",
"gulp-watch": "^4.3.11",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.29.0",
"webpack-cli": "^3.2.1"
},
"license": "ISC"
}
这些是调试显示的错误
20111 error code EINTEGRITY
20112 error sha1-fjL3W0e4epHQRhHxvxQQmsAGUdc= integrity checksum failed when using sha1: wanted sha1-fjL3W0e4epHQRhHxvxQQmsAGUdc= but got sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=. (36808 bytes)
20113 verbose exit [ 1, true ]
【问题讨论】:
-
请附上您的
package.json -
你读过日志文件吗?除了这个错误,它还说什么?
-
不,我尝试了那里提出的解决方案,但都没有奏效