2017-09-04 12 views
0

npm run devを実行しようとすると、このエラーが発生します。これは新しくインストールされたもので、別のフォルダの同じ設定で作業しています。別のコンピュータで同じエラーが発生する。Laravel npm run devはTypeErrorを返します。chunk.sortModulesは関数ではありません

バージョン NPM:5.3.0 ノード:V8.4.0

test ⚑ → npm run dev                                                              master ✗ 2d 

> @ dev /Users/myuser/Code/testing/test 
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js 

78% advanced chunk optimization/Users/myuser/Code/testing/test/node_modules/extract-text-webpack-plugin/dist/index.js:188 
      chunk.sortModules(); 
       ^

TypeError: chunk.sortModules is not a function 
    at /Users/myuser/Code/testing/test/node_modules/extract-text-webpack-plugin/dist/index.js:188:19 
    at /Users/myuser/Code/testing/test/node_modules/async/dist/async.js:3083:16 
    at eachOfArrayLike (/Users/myuser/Code/testing/test/node_modules/async/dist/async.js:1003:9) 
    at eachOf (/Users/myuser/Code/testing/test/node_modules/async/dist/async.js:1051:5) 
    at Object.eachLimit (/Users/myuser/Code/testing/test/node_modules/async/dist/async.js:3145:5) 
    at Compilation.<anonymous> (/Users/myuser/Code/testing/test/node_modules/extract-text-webpack-plugin/dist/index.js:184:27) 
    at Compilation.applyPluginsAsyncSeries (/Users/myuser/Code/testing/test/node_modules/tapable/lib/Tapable.js:206:13) 
    at Compilation.seal (/Users/myuser/Code/testing/test/node_modules/webpack/lib/Compilation.js:579:8) 
    at /Users/myuser/Code/testing/test/node_modules/webpack/lib/Compiler.js:493:16 
    at /Users/myuser/Code/testing/test/node_modules/tapable/lib/Tapable.js:289:11 
    at _addModuleChain (/Users/myuser/Code/testing/test/node_modules/webpack/lib/Compilation.js:481:11) 
    at processModuleDependencies.err (/Users/myuser/Code/testing/test/node_modules/webpack/lib/Compilation.js:452:13) 
    at _combinedTickCallback (internal/process/next_tick.js:131:7) 
    at process._tickCallback (internal/process/next_tick.js:180:9) 
npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! @ dev: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the @ dev script. 
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

npm ERR! A complete log of this run can be found in: 
npm ERR!  /Users/myuser/.npm/_logs/2017-09-04T13_55_30_770Z-debug.log 

答えて

0

これは私のために働きました。私は代わりに糸を使用しました。

rm -rf node_modules 
brew install yarn 
yarn 
yarn run dev 
3

問題は、ちょうど今日、私はレールのアプリでWebPACKのバージョン3を使用していますwebapackerバージョン3を更新したと私は同じエラーを取得して、パッケージの違いに関係しているようです。このパッケージをpackage.jsonファイルのこのバージョンにアップデートしたときに問題はなくなりました: "sass-loader": "^6.0.6" "babel-loader": "7.1.2" "webpack": "^3.6.0" この男の提案に感謝します。https://github.com/rails/webpacker/issues/852#issuecomment-331764386 これらのパッケージを使用している場合は、あなたにとっても。

+0

同じ問題が発生しました。あなたの答えは正しいです。 – taryn

関連する問題