2017-09-04 1 views
0

npm 실행 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

문제는 오늘은 레일 애플 리케이션에 웹팩 버전 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

관련 문제