본문 바로가기

React

이슈 8 Error: Cannot find module 'source-map-support/source-map-support.js'

반응형

모듈을 설치하고 나니 Electron 실행이 되지 않고, 아래와 같은 에러가 떴습니다.

┏ Electron -------------------

  App threw an error during load

┗ ----------------------------
┏ Electron -------------------

  Error: Cannot find module 'source-map-support/source-map-support.js'
  Require stack:
  - ~/project/dist/main/main.js
  - ~/project/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js
      at Module._resolveFilename (internal/modules/cjs/loader.js:659:15)
      at Function.Module._resolveFilename (~/project/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:43:12)
      at Function.Module._load (internal/modules/cjs/loader.js:577:27)
      at Module.require (internal/modules/cjs/loader.js:715:19)
      at require (internal/modules/cjs/helpers.js:14:16)
      at eval (webpack-internal:///source-map-support/source-map-support.js:1:18)
      at Object.source-map-support/source-map-support.js (~/project/dist/main/main.js:853:1)
      at __webpack_require__ (~/project/dist/main/main.js:704:30)
      at fn (~/project/dist/main/main.js:78:20)
      at eval (webpack-internal:///./node_modules/electron-webpack/out/electron-main-hmr/main-hmr.js:3:1)

┗ ----------------------------

모듈을 설치하다 충돌해서 source-map-support 모듈이 깨진 것으로 보입니다.

npm install 또는 yarn을 실행해주니 Electron이 켜집니다.

Uncaught Error: Cannot find module '~/project/node_modules/sqlite3/lib/binding/electron-v5.0-darwin-x64/node_sqlite3.node'
Require stack:
- ~/project/node_modules/sqlite3/lib/sqlite3.js
- ~/project/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/renderer/init.js
    at Module._resolveFilename (:9080/internal/modules/cjs/loader.js:659)
    at Function.Module._resolveFilename (:9080~/project/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:43)
    at Function.Module._load (:9080/internal/modules/cjs/loader.js:577)
    at Module.require (:9080/internal/modules/cjs/loader.js:715)
    at require (:9080/internal/modules/cjs/helpers.js:14)
    at Object.<anonymous> (:9080~/project/node_modules/sqlite3/lib/sqlite3.js:4)
    at Object.<anonymous> (:9080~/project/node_modules/sqlite3/lib/sqlite3.js:209)
    at Module._compile (:9080/internal/modules/cjs/loader.js:815)
    at Object.Module._extensions..js (:9080/internal/modules/cjs/loader.js:827)
    at Module.load (:9080/internal/modules/cjs/loader.js:677)

익숙한 에러가 뜨네요. npx electron-builder install-app-deps를 통해 해결해줍니다. 위 에러를 처음 보시는 분들은 다음 글을 참고하셔도 좋을 것 같습니다.

2020/01/14 - [엥휴/Electron-Webpack + React] - electron + sqlite3 "Cannot find module 'node_modules/...'"

 

electron + sqlite3 "Cannot find module 'node_modules/...'"

Cannot find module 'node_modules/sqlite3/lib/binding/electron-v5.0-darwin-x64/node_sqlite3.node' Require stack: node_modules/sqlite3/lib/sqlite3.js node_modules/knex/lib/dialects/sqlite3/index.js ya..

roomedia.tistory.com

 

반응형