美文网首页
webpack - peerDependencies WARNI

webpack - peerDependencies WARNI

作者: _Lalio | 来源:发表于2018-04-28 20:23 被阅读0次

    由于之前把node.js升级到了最新版,移除原先的node_modules文件加后,重新

       cnpm install
    

    出现以下错误信息:

    peerDependencies WARNING inject-loader@3.0.0 requires a peer of webpack@^1 || ^2 but webpack@3.6.0 was installed
    peerDependencies WARNING karma-sinon-chai@1.3.1 requires a peer of chai@^3.5.0 but chai@4.1.2 was installed
    peerDependencies WARNING karma-webpack@2.0.2 requires a peer of webpack@^1.1.0 || ^2 || ^2.1.0-beta.0 || ^2.2.0-rc.0 but webpack@3.6.0 was installed
    peerDependencies WARNING sinon-chai@2.8.0 requires a peer of chai@>=1.9.2 <4 but chai@4.1.2
    was installed
    peerDependencies WARNING karma-sinon-chai@1.3.1 requires a peer of sinon@^2.1.0 but sinon@40.0 was installed
    peerDependencies WARNING sinon-chai@2.8.0 requires a peer of sinon@>=1.4.0 <2 but sinon@4.00 was installed
    peerDependencies WARNING karma-sinon-chai@1.3.1 requires a peer of sinon-chai@^2.9.0 but sion-chai@2.8.0 was installed

    原因是package.json里面的一些依赖包的版本与node.js版本兼容问题导致的
    解决方法是把错误信息里提及的依赖包前面添加^,再cnpm install一下就可以了。
    例如

        "karma-sinon-chai": "^1.3.1"
        "sinon-chai": "^2.8.0"

    相关文章

      网友评论

          本文标题:webpack - peerDependencies WARNI

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