npm安装依赖错误

npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\Administrator\AppData\Local\n
pm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-ru
n
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! An unknown git error occurred
npm ERR! npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! npm ERR! git@github.com: Permission denied (publickey).
npm ERR! npm ERR! fatal: Could not read from remote repository.
npm ERR! npm ERR!
npm ERR! npm ERR! Please make sure you have the correct access rights
npm ERR! npm ERR! and the repository exists.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-09-02T01_57_04_188Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-09-02T01_59_44_422Z-debug.log

重新npm install

npm ERR! code 1
npm ERR! path E:\NingXiaEducationPMS\src\client\epms-web\node_modules\node-sass
npm ERR! command failed

国内淘宝镜像
npm i -g cnpm --registry=https://registry.npm.taobao.org
cnpm install node-sass

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lenovo\AppData\Roaming\npm-cache_logs\2020-02-18T05_24_41_971Z-debug.log

运行cmd命令:
npm install npm -g
查看npm版本:
npm -v
项目内:npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: smarteasy@3.8.0
npm ERR! Found: webpack@5.74.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from less-loader@10.2.0
npm ERR!   node_modules/less-loader
npm ERR!     less-loader@"^10.2.0" from the root project
npm ERR!   peer webpack@"^4.36.0 || ^5.0.0" from sass-loader@10.1.1
npm ERR!   node_modules/sass-loader
npm ERR!     dev sass-loader@"10.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev script-ext-html-webpack-plugin@"2.1.5" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" from script-ext-html-webpack-plugin@2.1.5
npm ERR!   node_modules/script-ext-html-webpack-plugin
npm ERR!     dev script-ext-html-webpack-plugin@"2.1.5" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Administrator\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-08-11T06_48_56_889Z-debug-0.log

npm install --legacy-peer-deps

npm安装依赖包报错时,可能有多种原因导致。其中一种常见的错误是 "The package-lock.json file was created with an old version of npm"。这个错误提示说明package-lock.json文件是使用较旧的npm版本创建的。这可能是因为你在使用较新的npm版本时,使用了一个已经存在的package-lock.json文件。 为了解决这个问题,你可以尝试以下步骤: 1. 首先,你可以尝试删除已存在的package-lock.json文件和node_modules文件夹。你可以使用命令sudo rm -rf node_modules package-lock.json来删除它们。 2. 然后,你需要更新你的npm版本,以确保与package-lock.json文件兼容。你可以使用npm install -g npm命令来更新npm。更新完成后,重新运行npm install命令来安装依赖包。 这样,你应该能够成功安装依赖包并解决npm安装依赖包报错的问题。请记得在进行这些操作之前备份你的项目文件,以防意外情况发生。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [前端-工作中 npm install 安装依赖报错常见总结](https://blog.csdn.net/inthat/article/details/120564807)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值