node js版本低导致冲突WARN EBADENGINE package: required: { node: ‘>=18‘ }
重新安装依赖包
1、删除旧的 node_modules
目录和 package-lock.json
文件:
rm -rf node_modules
rm package-lock.json
2、升级node版本
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 18
nvm use 18
3、重新安装你需要的依赖包:
npm install xxx