LoginSignup
8
2

More than 3 years have passed since last update.

yarn create nuxt-app 「'C:\Program' は、内部コマンドまたは外部コマンド、 操作可能なプログラムまたはバッチ ファイルとして認識されていません。」

Posted at

個人的に少しハマったのでメモ

事象

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

8
2
1

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
8
2