nodejs版本与npm版本拿些破事儿

1.npm版本应该与node版本相对应,否则npm任何命令都用不了

2.npm要降低版本:

     npm install npm@x.x.x -g

     降低版本以后,与node版本不再对应,应当相应的安装新的node与之对应

3.npm更新到最新:

        npm install -g npm

        npm更新后,nodejs应该重新安装最新版本与之对应

4.总结:

        当环境要求node特定版本时,先将npm安装目标版本,然后重新安装与之对应得node版本

ps:

        nodejs17在运行某些项目时,因为环境原因会报如下错误


Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\Item\springbootVue\springboot\vue\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\Item\springbootVue\springboot\vue\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\Item\springbootVue\springboot\vue\node_modules\webpack\lib\NormalModule.js:471:10)

npm与node对应关系表

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值