原来使用的node版本是v10.15.0,npm使用也是一切正常。后来安装了一个node版本管理工具(mac是n),安装了几个node版本测试,然后又删了几个版本。在使用npm -v的时候就报错了:(说让我升级node版本)
ERROR: npm is known not to run on Node.js v10.15.0
You'll need to upgrade to a newer Node.js version in order to use this
version of npm. You can find the latest version at https://nodejs.org/
通过node版本管理工具,换成了v14的,npm -v可以看当前版本了,但是npm 其他安装命令都报错了,
如:npm install
报错如下:
code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ngx-daterangepicker-material@1.3.4
npm ERR! Found: moment@2.24.0
npm ERR! node_modules/moment
npm ERR! moment@"^2.23.0" from the root project
npm ERR! moment@"^2.10.2" from chart.js@2.8.0
npm ERR! node_modules/chart.js
npm ERR! chart.js@"^2.7.3" from the root project
npm ERR! 1 more (@angular/material-moment-adapter)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer moment@"2.21.0" from ngx-daterangepicker-material@1.3.4
npm ERR! node_modules/ngx-daterangepicker-material
npm ERR! ngx-daterangepicker-material@"^1.2.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: moment@2.21.0
npm ERR! node_modules/moment
npm ERR! peer moment@"2.21.0" from ngx-daterangepicker-material@1.3.4
npm ERR! node_modules/ngx-daterangepicker-material
npm ERR! ngx-daterangepicker-material@"^1.2.7" 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 /Users/kangran/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kangran/.npm/_logs/2022-07-11T05_36_17_190Z-debug-0.log
这是什么情况,我的npm不能用了,怎么办?