关于环信webIM编译遇到的问题

关于环信webIM编译遇到的问题

在用环信web端的时候编译总出现报错。

throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);

错误如下:

> huanxin@1.0.0 dev /Users/kjwx/code/webIM
> /usr/local/bin/node /Users/kjwx/code/webIM/build/dev-server.js

/Users/kjwx/code/webIM
/Users/kjwx/code/webIM/node_modules/.2.2.1@webpack/lib/webpack.js:19
        throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
        ^

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.resolve.extensions[0] should not be empty.
    at webpack (/Users/kjwx/code/webIM/node_modules/.2.2.1@webpack/lib/webpack.js:19:9)
    at Object.<anonymous> (/Users/kjwx/code/webIM/build/dev-server.js:5:22)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:449:3

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! huanxin@1.0.0 dev: `/usr/local/bin/node /Users/kjwx/code/webIM/build/dev-server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the huanxin@1.0.0 dev script '/usr/local/bin/node /Users/kjwx/code/webIM/build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the huanxin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     /usr/local/bin/node /Users/kjwx/code/webIM/build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs huanxin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls huanxin
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kjwx/code/webIM/npm-debug.log

一编译就报这个错误,问过环信的技术人员后也无果。

后来在伟大的google中隐约发现了这个问题的解决方案,在看环信的package.json文件中 “webpack”: “*” ,说明webpack的版本npm install的时候可能是最新版,所以我是这么解决的。

    npm uninstall webpack --save-dev
    cnpm install webpack@2.1.0-beta.21 --save-dev

简单点来说就是先将原来的webpack给卸载掉,然后在安装一个指定版本的webpack就可以了。


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值