node module version conflict when installing modules for electron

前端 未结 3 1576
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 07:17

I\'m trying to make an Electron application (https://electron.atom.io/) that reads data from my serial port. I\'m new to web technologies in general, I know some javascript,

3条回答
  •  失恋的感觉
    2020-12-05 07:27

    Create file .npmrc with content:

    runtime = electron
    target = 1.7.5
    target_arch = x64
    disturl = https://atom.io/download/atom-shell
    export npm_config_runtime=electron
    export npm_config_build_from_source=true
    

    Open another terminal and run npm install [yourpackage]

    Keep in mind, some new packages would be installed with highest electron version (target), so save yourself some headache/backache and update your target = with the current version stated on npm or github page.

提交回复
热议问题