본문 바로가기
개발 및 운영

Error: Cannot find module 'electron' 문제발생시

by Joseph.Lee 2019. 11. 1.
 INFO  Launching Electron...
internal/modules/cjs/loader.js:630
    throw err;
    ^
Error: Cannot find module 'electron'
Require stack:
- ...\electron-output\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:627:15)
    at Function.Module._load (internal/modules/cjs/loader.js:531:27)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at eval (webpack:///external_%22electron%22?:1:18)
    at Object.electron (...\electron-output\index.js:2146:1)
    at __webpack_require__ (...\electron-output\index.js:20:30)
    at eval (webpack:///./background/background.ts?:3:66)
    at Module../background/background.ts (...\electron-output\index.js:133:1)
    at __webpack_require__ (...\electron-output\index.js:20:30) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    ...\\electron-output\\index.js'
  ]
}
Done in 26.02s.

ELECTRON_RUN_AS_NODE 환경변수를 확인해 보아야 한다.

(Windows 환경임)

> set ELECTRON_RUN_AS_NODE=0

이건 node로 실행하지 않겠다는 뜻이지만...

> set ELECTRON_RUN_AS_NODE=0

이게 있으면 위와 같은 문제가 발생한다...ㅠㅠ 겁나 삽질함....

반응형

댓글