個人的に少しハマったのでメモ
事象
yarn createでNuxtのプロジェクトを作成しようとした際にエラー
PS C:\Users\myname> yarn create nuxt-app helloworld
yarn create v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-nuxt-app@2.12.0" with binaries:
- create-nuxt-app
'C:\Program' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
error Command failed.
Exit code: 1
Command: C:\Program Files (x86)\Nodist\bin\bin\create-nuxt-app
Arguments: helloworld
Directory: C:\Users\myname
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
環境
- OS: Windows10
- yarn: v1.21.1
- node: v10.15.2(Nodistでバージョン管理)
- Nodist: 0.8.8
原因
NodistのインストールディレクトリをデフォルトのC:\Program Files (x86)
配下にしてしまったため、実行時コマンドに半角スペースが入ってしまい正しくcreate-nuxt-app
が実行できない。
暫定対応
本来はNodistのインストールディレクトリを変更するなどが好ましいが、直接create-nuxt-app
があるディレクトリを指定して実行する。
c:\Progra~2\Nodist\bin\bin\create-nuxt-app helloworld
Progra~2
の表記については以下の記事を参照
https://grum.hatenablog.com/entry/2017/05/16/110000