작성
·
124
1
강의를 들으며 실습을 따라하던 중 npm run dev 부분에서 에러가 발생하였습니다. 몇 달전에 올라온 npm run start:dev로 고쳐서도 실행해 보았지만 해결이 되지 않았습니다.
이러한 로그가 발견되었습니다. 어떻게 해결하여야 할까요?
답해주시면 감사하겠습니다.
[webpack-cli] Failed to load '/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/webpack.config.js' config
[webpack-cli] Error: Cannot find module 'loader-utils'
Require stack:
- /Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/html-webpack-plugin/index.js
- /Users/parkjiseok/Desktop/LearnWebpack-master/devserver/webpack.config.js
- /Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack-cli/lib/webpack-cli.js
- /Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack-cli/lib/bootstrap.js
- /Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack-cli/bin/cli.js
- /Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack/bin/webpack.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/html-webpack-plugin/index.js:17:21)
at Module._compile (/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/html-webpack-plugin/index.js',
'/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/webpack.config.js',
'/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack-cli/lib/webpack-cli.js',
'/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack-cli/lib/bootstrap.js',
'/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack-cli/bin/cli.js',
'/Users/parkjiseok/Desktop/LearnWebpack-master/devserver/node_modules/webpack/bin/webpack.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! devserver@1.0.0 start:dev: `webpack serve`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the devserver@1.0.0 start: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/parkjiseok/.npm/_logs/2021-03-08T04_21_54_981Z-debug.log
답변 1
0
안녕하세요, 현재 로컬에 설치된 프로그램들 각각 버전 확인해서 알려주시겠어요?
- Node.js
- NPM
- 실습 폴더의 webpack, webpack-cli 버전
node.js 는 현재 v14.16.0을
npm은 6.14.11을
webpack은 5.24.4를
webpack-cli은 4.5.0을 쓰고 있습니다!