web pack 에러

20.02.29 23:06 작성 조회수 499

1

Insufficient number of arguments or no entry found.

Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: d6c939b5a5a99e62ccf4

Version: webpack 4.41.6

Time: 28ms

Built at: 02/29/2020 10:56:21 PM

WARNING in configuration

The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' optio

n to 'development' or 'production' to enable defaults for each environment.

You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configur

ation/mode/

ERROR in Entry module not found: Error: Can't resolve './src' in '/Users/yun-ali/Downloads/LearnWebpack-ma

ster'

답변 10

·

답변을 작성해보세요.

1

univue님의 프로필

univue

질문자

2020.03.03

1

univue님의 프로필

univue

질문자

2020.03.03

1

univue님의 프로필

univue

질문자

2020.03.02

{

  "name": "getting-started",

  "version": "1.0.0",

  "scripts": {

    "test": "echo \"Error: no test specified\" && exit 1",

    "build": "webpack"

  },

  "description": "",

  "main": "webpack.config.js",

  "keywords": [],

  "author": "",

  "license": "ISC"

}

1

univue님의 프로필

univue

질문자

2020.03.01

internal/modules/cjs/loader.js:250

    throw e;

    ^

SyntaxError: Error parsing /usr/local/lib/node_modules/webpack/package.json: Unexpected string in JSON at

position 8557

    at JSON.parse (<anonymous>)

    at readPackage (internal/modules/cjs/loader.js:239:25)

    at readPackageScope (internal/modules/cjs/loader.js:263:19)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:966:17)

    at Module.load (internal/modules/cjs/loader.js:811:32)

    at Function.Module._load (internal/modules/cjs/loader.js:723:14)

    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)

    at internal/main/run_main_module.js:17:11 {

  path: '/usr/local/lib/node_modules/webpack/package.json'

}

npm ERR! code ELIFECYCLE

Git

GitHub

Create Repository

Initialize /Users/yun-ali/Downloads/LearnWebpack with a Git repository

Create repository

npm ERR! errno 1

npm ERR! getting-started@1.0.0 build: `webpack`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the getting-started@1.0.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/yun-ali/.npm/_logs/2020-03-01T10_32_35_467Z-debug.log

1

univue님의 프로필

univue

질문자

2020.03.01

npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/yun-ali/.npm/_logs/2020-03-01T09_55_11_550Z-debug.log

1

univue님의 프로필

univue

질문자

2020.02.29

webpack 치면 에러가 자꾸 납니다.

0

윤희님 혹시 다음에 진행하실 때 제가 원격으로 한번 봐드리면 좋을 것 같은데 진행하시기 전에 질문 한번 남겨주세요 ㅎㅎ

0

오잉 윤희님, 위 json 파일 형식에는 딱히 에러 나는게 없네요..! 그런데도 npm run build 명령어가 안 먹나요?

0

안녕하세요 윤희님, package.json 내용이 아래와 같이 잘 작성되었는지 한번 확인해보세요..! :)

{
  "name": "...",
  "version": "...",
  "scripts": {
     "build": "webpack"
  },
  ...
}

0

윤희님 아래 문서의 6번 참고하셔서 package.json 파일에 "scripts" 관련된 코드 넣어주시고 `npm run build` 한번 돌려보세요 :)

https://joshua1988.github.io/webpack-guide/getting-started.html#%EC%8B%A4%EC%8A%B5-%EC%A0%88%EC%B0%A8-%EC%9B%B9%ED%8C%A9-%EB%B9%8C%EB%93%9C%EB%A5%BC-%EC%9C%84%ED%95%9C-%EA%B5%AC%EC%84%B1-%EB%B0%8F-%EB%B9%8C%EB%93%9C