Memo

メモ > 技術 > 開発: Electron > Electronのインストール

■Electronのインストール
コマンドプロンプトでコマンドを実行する
>npm install -D electron > core-js@3.18.3 postinstall C:\Users\Yamano\Electron\sample\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js: > https://opencollective.com/core-js > https://patreon.com/zloirock > https://paypal.me/zloirock > bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) > electron@15.3.0 postinstall C:\Users\Yamano\Electron\sample\node_modules\electron > node install.js npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Yamano\Electron\sample\package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Yamano\Electron\sample\package.json' npm WARN sample No description npm WARN sample No repository field. npm WARN sample No README data npm WARN sample No license field. + electron@15.3.0 added 87 packages from 96 contributors and audited 87 packages in 14.485s 6 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
■動作確認 以下でバージョンを確認
>npx electron -v v15.3.0
以下でデフォルトアプリを実行
>npx electron
画面内には、以下のような情報が表示されている
Electron v15.3.0 Chromium v94.0.4606.81 Node v16.5.0 v8 v9.4.146.21-electron.0 To run a local app, execute the following on the command line: $ node_modules\electron\dist\electron.exe path-to-app
■バージョンアップする場合 ※未検証 以下のコマンドを実行する
> npm install --save-dev electron@latest

Advertisement