- 开发无止境 -
Data: 2022-04-23 11:40:08Form: JournalClick: 18
1.
mpm ERR! Unexpected end of JSON input while parsing near ...
npm ERR! errno -4048
npm ERR! syscall scandir
npm cache clean --force
npm install
2.
npm ERR! cb() never called!
npm ERR! This is an error with npm itself.
1. 删除npm文件夹下面的node_modules
2. 删除当前项目文件夹的node_modules
3. 删除package-lock.json文件
4. npm cache clean --force
5. npm install
3.
npm ERR! chromedriver@2.46.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR! deasync@0.1.21 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR! phantomjs-prebuilt@2.1.13 install: `node install.js`
npm ERR! Exit status 1
npm install --ignore-scripts
npm install deasync@0.1.21 --ignore-scripts
4.
Cannot download 'xxxx'
HTTP error 404 Not Found
sass_binary_site = https://npm.taobao.org/mirrors/node-sass
phantomjs_cdnurl = http://10.25.220.15:8080
5.
code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm i --legacy-peer-deps
ERESOLVE相关的报错原因大多也确实是npm7与npm6之间的差异所导致的。
当然你也可以选择降版本到npm6来解决。
6.
Error: error:0308010C:digital envelope routines::unsupported
这个错误信息指的是 OpenSSL 的一个错误, OpenSSL 的数字信封操作中使用了不受支持的算法或者操作。这可能是因为 OpenSSL 版本不同,或者一些特定的配置问题。
我们可以指定 Node.js 使用旧版的 OpenSSL 提供程序。
或遇到此类未知问题也可以尝试这个方法
npm ERR! code ELIFECYCLE
npm ERR! errno 1
set NODE_OPTIONS=--openssl-legacy-provider
export NODE_OPTIONS=--openssl-legacy-provider
$env:NODE_OPTIONS = "--openssl-legacy-provider"
另外一个方法是在项目的package.json文件里将
"start": "react-scripts start"
替换成:
"start": "react-scripts --openssl-legacy-provider start"
7.
code
CERT_HAS_EXPIRED
清除npm缓存
npm cache clean --force
取消ssl验证:
npm config set strict-ssl false
之后再npm install 你想安装的东西
再不行的话试试更换npm镜像源:
npm config set registry http://registry.cnpmjs.org
npm config set registry http://registry.npm.taobao.org
8.
peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.15
手动指定安装依赖(降低版本到6.xx)
npm install eslint@6
如还在保存尝试降低npm版本(-g全局安装npm版本到6.xx)
npm install -g npm@6