Windows で Electron[Windows]
(2019-01-04 16:35:58) by shinoda


< ページ移動: 1 2 >

Windows 7 Professional SP1 で Electron の開発環境を作成する。

Mac OS X のときと一緒で、まずはもっとも重要なプログラム実行エンジンである Node.js のインストール。

Node.js のダウンロードサイトから、

https://nodejs.org/en/

最新のインストール用プログラムを落としてくる。2019/01/04 現在では、node-v10.15.0-x64.msi が安定版の最新バージョンだった。

インストール方法は書かない。MSI ファイルを実行して、あとは指示に従うだけ。某社のソフトみたいにこっそり McAfee を入れたりしようとはしないので安心しとけ(笑)
「Finish」ボタンを押して終わり。

コマンドプロンプトで、node を実行しても、

>node -v
'node' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

だったものが、ちゃんと、

>node -v
v10.15.0

このように実行される。(インストール後、)

次に、Electronのインストール。
Electron は Node.js のパッケージの一つなので、パッケージ管理コマンドでインストールを行う。

ところで、Mac OS X ではグローバルインストールを行ったのだが、それだと Electron の Update を行った時などに、動かないプロジェクトが出てくる可能性があるそうだ。
(バージョン依存の機能なんか使ってる場合だな)

というわけで、さきにプロジェクトを作って、そこにローカルインストールすることにする。このプロジェクトで使われるだけの Electron だ。

今回は個別案件管理システムを作りたいので、kobetsu という名前で作ろう。

>mkdir \Users\shinoda\electron\kobetsu

>cd \Users\shinoda\electron\kobetsu

>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (kobetsu)
version: (1.0.0)
description: 個別案件管理
entry point: (index.js)
test command:
git repository:
keywords:
author: shinoda
license: (ISC)
About to write to C:\Users\shinoda\electron\kobetsu\package.
json:

{
  "name": "kobetsu",
  "version": "1.0.0",
  "description": "個別案件管理",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "shinoda",
  "license": "ISC"
}


Is this OK? (yes)

ちゃんと package.json が出来上がっているかな?

< ページ移動: 1 2 >


コメント投稿
次の記事へ >
< 前の記事へ
TOPへ戻る

Powered by
MT4i 3.0.8