美文网首页
To use this template, you must u

To use this template, you must u

作者: 天渺工作室 | 来源:发表于2023-01-03 00:03 被阅读0次

    旧项目在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 npm@vx.xx // 下载制定版本
    

    情况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"
    }
    

    相关文章

      网友评论

          本文标题:To use this template, you must u

          本文链接:https://www.haomeiwen.com/subject/rjgkcdtx.html