New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

au new command exits early when a local CLI is installed in the current folder #977

Closed
freshcutdevelopment opened this Issue Nov 16, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@freshcutdevelopment
Copy link

freshcutdevelopment commented Nov 16, 2018

I'm submitting a bug report

  • Library Version:
    1.0.0-beta.5

  • Operating System:
    OSX 10.x|Linux (distro)|Windows [7|8|8.1|10]

  • Node Version:
    6.2.0

  • NPM Version:
    3.8.9
  • Browser:
    all

  • Language:
    all

  • Loader/bundler:
    all

Current behavior:
If you accidentally install the Aurelia CLI locally rather than globally by running npm install aurelia-cli rather than npm install aurelia-cli -g then when you run the au new command the CLI exits immediately with the message No Aurelia project found

  • What is the expected behavior?

The expected behavior is that the CLI should either not exit early and go head to create the project. Or alternatively, show a more informative message like Could not create Aurelia project, please remove local version of Aurelia CLI before running this command.

  • What is the motivation / use case for changing the behavior?
    In the past week, I've run into this situation two times when attempting to get new devs started with Aurelia. If we can get this workflow streamlined it makes the on-ramp for new developers much smoother.
@wallaceturner

This comment has been minimized.

Copy link

wallaceturner commented Nov 27, 2018

does the local version simply not work? i've got a situation where i'm using 0.34 for production but want to try out 1.0.0-beta.6 before migrating too it but am running into this same error. you can't have 2 aurelia-cli's side by side ?

@huochunpeng

This comment has been minimized.

Copy link
Member

huochunpeng commented Nov 27, 2018

If you install 1.0.0.beta.6 globally, your existing app with 0.34 will still build and run using local 0.34.

Even with global cli upgraded, your existing apps on whatever cli version will continue to use the old version until you update app’s local pacakage.json for aurelia-cli dependency.

You can use au new to create new v1.0.0 based apo skeleton. The question is why you need to run au new in a folder which has local cli installation?

This issue is about to print understandable error message, not to fix some cli bug.

People usually come to this issue when they mistakenly ran npm i aurelia-cli instead of npm i -g aurelia-cli to upgrade global installed cli.

@freshcutdevelopment

This comment has been minimized.

Copy link
Author

freshcutdevelopment commented Nov 27, 2018

Yes, this issue is specifically about putting in place a friendlier error/ warning message to indicate to new users why they're unable to create their project.

@wallaceturner

This comment has been minimized.

Copy link

wallaceturner commented Nov 27, 2018

Yes, this issue is specifically about putting in place a friendlier error/ warning message to indicate to new users why they're unable to create their project.

or, as the OP states

The expected behavior is that the CLI should either not exit early and go head to create the project.

huochunpeng added a commit to huochunpeng/cli that referenced this issue Dec 19, 2018

huochunpeng added a commit to huochunpeng/cli that referenced this issue Dec 19, 2018

fix: avoid early exist of "au new"
Don't try to find local aurelia project when running "au new".
Always use global aurelia-cli to execute "au new".
Log cli version.

closes aurelia#977

huochunpeng added a commit to huochunpeng/cli that referenced this issue Dec 19, 2018

fix: avoid early exist of "au new"
Don't try to find local aurelia project when running "au new".
Always use global aurelia-cli to execute "au new".
Log cli version.

closes aurelia#977
@huochunpeng

This comment has been minimized.

Copy link
Member

huochunpeng commented Dec 19, 2018

The merged fix did the proper thing: it ensures "au new" is executed by global installed cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment