4
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 5 years have passed since last update.

Yeoman + generator-ionic環境でyo ionicを実行した時に、Please run `yo ionic` in an empty directoryと表示される解決方法

Last updated at Posted at 2014-10-23

Yeoman+generator-ionicを使用して、ionic環境を作成しました。Yeomanはインストール済みです。

generator-ionicをインストールして環境構築

npm install -g generator-ionic

generator-ionicをインストールしました。

yo ionicを実行

yo ionicを実行します

yo ionic

 略

[?] Would you like to use Sass with Compass (requires Ruby)? No
Created a new Cordova project with name "Ionic" and id "com.example.Ionic"
[?] Which Cordova plugins would you like to include? org.apache.cordova.console, org.apache.cordova.device
[?] Which starter template [T] or example app [A] would you like to use? [T] Blank

 略

Installing selected Cordova plugins, please wait.
{ [CordovaError: Current working directory is not a Cordova-based project.]
  name: 'CordovaError',
  message: 'Current working directory is not a Cordova-based project.' }
✗ Please run `yo ionic` in an empty directory, or in that of an already existing cordova project.

空のディレクトリ内でyo ionicを実行しろと表示されました。

既に存在したhogeディレクトリの中でyo ionicを実行したのですが、不要なファイルがいくつか合ったので、hogeディレクトリを一削除しました。次に、新たにhogeディレクトリを作成し、ディレクトリの中に移動してからyo ionicコマンドを実行します。

cd ../ # hogeディレクトリから出ました
rm -rf hoge
mkdir hoge 
cd hoge
yo ionic

今度はエラーが出ず、生成に成功しました。

参考

https://github.com/diegonetto/generator-ionic
https://github.com/diegonetto/generator-ionic/issues/47

4
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
4
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?