Skip to content
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 · Fixed by #1002
Closed

Comments

@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
Copy link

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 ?

@3cp
Copy link
Member

3cp 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
Copy link
Author

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
Copy link

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.

@3cp
Copy link
Member

3cp 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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants