yeoman creates project in Desktop even though I CD into directory

后端 未结 2 1496
一个人的身影
一个人的身影 2021-01-29 01:58

I am having a issue creating a yeoman project. I cd in the directory type yo and it says:

Here is it suppose to asked me project name etc and it wants to t

2条回答
  •  梦谈多话
    2021-01-29 02:37

    If you have a .yo-rc.json file in a parent directory, Yeoman will load that configuration and generate from that file instead of prompting. This allows developers to run a yo command from any folder in the project and have it apply to the correct files.

    To solve this, remove the .yo-rc.json from the parent directory, in your case /Users/drew/Desktop.

    For example, if you are in the directory /Users/drew/Desktop/new-project but /Users/drew/Desktop has a .yo-rc.json inside, Yeoman will change to the parent directory (Desktop), load the configuration, and generate the files from that folder instead of the child folder.

提交回复
热议问题