错误:无法parsing模块'babel-loader'

我试图在我的package.json中的postinstall脚本上运行webpack,当我推送到heroku,但我得到以下错误。

ERROR in Entry module not found: Error: Cannot resolve module 'babel-loader' in /tmp/build_6cb4b10367d9382367ab72f2e2f33118 

当我在本地运行命令时,我没有问题。 下面是我的webpackconfiguration – 我曾尝试使用resolveLoader来解决问题,但无济于事?

 var path = require('path'); var webpack = require('webpack'); var config = { entry: path.resolve(__dirname, './app/main.js'), output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, { test: /\.less$/, loader: 'style!css!less' }] }, resolve: { extensions: ['', '.js', '.jsx', '.less'], modulesDirectories: [ 'node_modules' ] }, resolveLoader: { root: path.resolve(__dirname, 'node_modules') }, plugins: [ new webpack.optimize.UglifyJsPlugin({minimize: true}) ] }; module.exports = config; 

有什么build议么? 谢谢

       

网上收集的解决方案 "错误:无法parsing模块'babel-loader'"