首页 > 其他分享 >To use this template, you must update following to modules:npm xxx should be xxx

To use this template, you must update following to modules:npm xxx should be xxx

时间:2023-01-04 00:11:22浏览次数:40  
标签:npm use engines xxx should template

旧项目在webpack配置升级和把npm升级pnpm过程中,webapck打包遇到报类似的错

情况1

To use this template, you must update following to modules:  

 npm: 7.0.0 should be >= 9.0.0

npm: 7.0.0 should be >= 9.0.0,如有提示具体的版本信息。
升级npm或者把npm升级到>=后制定的版本就行。

npm install -g npm  //  下载最新版本
// 或者
npm install -g [email protected] // 下载制定版本

情况2

To use this template, you must update following to modules:  

 npm: 7.0.0 should undefined

报错提示后面为undefined,遇到这样的情况就要查看项目中package.json中engines配置是否存在异常,全局搜索engines是否在webpack配置中引用了。
PS:我的打包异常是因为"npm": ">= 6.0.0" 改为"pnpm": ">= 6.0.0"导致的(webpack配置中引用了engines.npm),

"engines": {
        "node": ">= 8.16.0",
        "npm": ">= 6.0.0"
}

标签:npm,use,engines,xxx,should,template
From: https://www.cnblogs.com/tianmiaogongzuoshi/p/17023755.html

相关文章