1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

create-nuxt-appをバージョン指定 on Docker

Posted at

何回かつまづいたのでメモ。
create-nuxt-appは3.Xからサーバーサイドフレームワークの選択がなくなり不便だったりするので2.Xをインストールする。Docker使って。

$ docker run --rm -it -w /app -v `pwd`:/app node /bin/bash -c "yarn global add create-nuxt-app@2.15.0; npx create-nuxt-app アプリ名"

docker runコマンドのオプションは

  • --rm:コマンド実行終わったらコンテナ削除
  • -itnpx create-nuxt-appで対話形式で入力が必要なので
  • -w /app:コンテナのワーキングディレクトリを指定。なんでもOKだけど/app
  • -v `pwd`:/app:ローカルとコンテナのボリュームをマウント。pwd使ってカレントディレクトリをマウントしてる。コンテナ内の/appにNuxtアプリが作られるので最終的にローカルのカレントディレクトリにできる。

です。

docker runのコマンドは/bin/bash -c "command1; command2; command3"のように;でつなげることで&&みたいに複数コマンドを渡すことができます。

yarn create nuxt-appも試してみたけど最新バージョンのcreate-nuxt-appがなぜか適用されてうまくいかなかったのでnpx使ってます。

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?