haiju's 開発メモ

開発に必要な情報を自分用にメモ

Manjaro GNOME 18.0_x86-64にcreate-elm-appでElmプロジェクトを作成

環境が動かない場合は、だいたい公式ドキュメントの情報をスルー

して、自己流で「多分こうなるはず」で動かしてる場合が多い。

create-elm-appも「-g」オプションがあるからグローバルにインストール

を敬遠で無理やり試行錯誤じゃなくて、とりあえず、公式ドキュメント

に従って作業してみるべきだと思った(深く反省)

[手順]

 1. npm or yarn でグローバルにインストール。

% npm install -g create-elm-app または

% yarn global add create-elm-app

npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated fsevents@1.2.4: Way too old
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated sw-precache@5.2.1: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated sw-toolbox@3.6.0: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
/home/haiju/.nvm/versions/node/v8.16.0/bin/elm-app -> /home/haiju/.nvm/versions/node/v8.16.0/lib/node_modules/create-elm-app/bin/elm-app-cli.js
/home/haiju/.nvm/versions/node/v8.16.0/bin/create-elm-app -> /home/haiju/.nvm/versions/node/v8.16.0/lib/node_modules/create-elm-app/bin/create-elm-app-cli.js

> elmi-to-json@0.19.1 install /home/haiju/.nvm/versions/node/v8.16.0/lib/node_modules/create-elm-app/node_modules/elmi-to-json
> binwrap-install


> elm@0.19.0 install /home/haiju/.nvm/versions/node/v8.16.0/lib/node_modules/create-elm-app/node_modules/elm-webpack-loader/node_modules/elm
> binwrap-install


> elm@0.19.0-bugfix6 install /home/haiju/.nvm/versions/node/v8.16.0/lib/node_modules/create-elm-app/node_modules/elm
> binwrap-install


> core-js@2.6.9 postinstall /home/haiju/.nvm/versions/node/v8.16.0/lib/node_modules/create-elm-app/node_modules/core-js
> node scripts/postinstall || echo "ignore"

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 on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/create-elm-app/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/create-elm-app/node_modules/elm-test/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/create-elm-app/node_modules/elm-test/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ create-elm-app@3.0.8
added 1371 packages from 749 contributors in 50.888s

 2. 1でインストールしたcreate-elm-appでテスト用プロジェクトを作成。

% create-elm-app my-app 

Creating my-app project...

Starting downloads...

● elm/json 1.1.2
● elm/virtual-dom 1.0.2
● elm-explorations/test 1.0.0

Dependencies ready!
Success! Compiled 1 module.

Project is successfully created in `/home/haiju/my-app`.

Inside that directory, you can run several commands:

elm-app start
Starts the development server.

elm-app build
Bundles the app into static files for production.

elm-app test
Starts the test runner.

elm-app eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd my-app
elm-app start

 3. 2で作成したプロジェクトへ移動。

% cd my-app

 4. ローカルサーバーを起動。

% elm-app start

 ※4で起動に成功すると、ターミナルは下記表示になっている。

f:id:haiju:20190627160533p:plain

 ※ローカルサーバーの起動に成功すると、自動でWebブラウザが上記URL

 (http://localhost:3000/)にアクセスした状態で開く。

f:id:haiju:20190627160559p:plain

 

[参考サイト]

github.com

qiita.com

qiita.com

create-elm-app/README.md at master · halfzebra/create-elm-app · GitHub

scrapbox.io