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

fix: check for old version of the CLI on empty project #2178

Closed

Conversation

ValeryVS
Copy link
Contributor

On empty project, when config files are not exists CliConfig.configFilePath will return null.
null is not valid argument for readFileSync
There was TypeError: path must be a string or Buffer
#2135

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@ValeryVS
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@ValeryVS
Copy link
Contributor Author

This error was with node 6.5.0

@BenoitFroment
Copy link

just updated to node 6.6.0, same errors

@filipesilva
Copy link
Contributor

Putting this PR on hold until we can figure out what's happening in #2135.

@ValeryVS
Copy link
Contributor Author

When there is no angular-cli.json
at this line
https://github.com/ValeryVS/angular-cli/blob/65393147df665f45ebe835a10a3de4c68728d324/packages/angular-cli/upgrade/version.ts#L78
configPath will be null, because CliConfig.configFilePath() will retun null

static configFilePath(projectPath?: string): string {

using _findup function

@GabrielDumbrava
Copy link

Can you please merge this PR. It's really annoying to not be able to use the new command. If I create the missing angular-cli.json file as a workaround I get the error:
You cannot use the new command inside an angular-cli project.

@ValeryVS ValeryVS force-pushed the fix/check-for-old-cli-version branch from ee1d0c8 to 6772797 Compare September 28, 2016 08:15
@ValeryVS
Copy link
Contributor Author

Rebased to master

@filipesilva
Copy link
Contributor

@ValeryVS thanks for the explanation and fix for this issue. Can you add a test to ensure we don't run into it again?

You can add it in tests/e2e/tests/misc/version.ts. It seems to be enough to delete angular-cli.json and run ng version to reproduce the problem, so that should be enough to do in the test to make sure your fix works.

@miuel
Copy link

miuel commented Oct 7, 2016

Thanks @ValeryVS to solve it !

@filipesilva
Copy link
Contributor

I amended your commit with said test and pushed it to master. Thanks!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants