0



This might be a stupid question, but I couldn't find any answer to it.
I'm currently working on an Angular2+ project with a team (Angular 6.0.0 to be precise). We use Git in order to share and merge code (I'm far from being a git nor Angular expert though!).

This morning I created a branch to update Angular CLI from version 6.0.0 to 6.1.1 and then merge this branch with master.

[edit] I did exactly:
git checkout -b UPDATE/AngularCLI_6.1.1
npm install --save-dev @angular/cli@latest (took a while)
ng -v (showed Angular CLI: 6.1.1)
Then I opened a merge request that has been validated by my peers.
Then I did :
git checkout -b FEATURE/blabla
git pull origin master

After I pulled "origin master" from my feature branch, I ran "ng -v" and saw such warning :
"Your global Angular CLI version (6.1.1) is greater than your local version (6.0.0). The local Angular CLI version is used."
I then checked my package.json file and it states :
"@angular/cli@^6.1.1": version "6.1.1"

Now I'm lost :') Shouldn't my morning update be taken into account when using Angular CLI commands ?
Thanks in advance !

[edit] Thanks to @jonatjano, I ran "yarn install" in my folder then "ng -v" would indicate the right version.

2
  • Please provide more details. What were the exact steps you performed when you "created a branch to update Angular CLI from version 6.0.0 to 6.1.1 and then merge this branch with master."? Commented Jul 31, 2018 at 15:10
  • try running npm or yarn whatever you use to make the node_module folder up to date Commented Jul 31, 2018 at 15:14

1 Answer 1

2

As @jonatjano mentions in the comments,

try running npm or yarn whatever you use to make the node_module folder up to date

I ran yarn install and ng -v now indicates the right version.

Sign up to request clarification or add additional context in comments.

5 Comments

Isn't it an answer ? I thought that the answer to "why the update is not taken into consideration on my local branch" was "because I did not run 'yarn install' on my local branch", and I thought those steps could help others to upgrade their Angular + Git projects. But I'm not that familiar with Stack Overflow processes (this is my second post), so I'll be glad to hear what you think about this discussion :)
The answer was on the spot, don't worry much. The issue was with the formatting and phrasing though, which you will learn as you start to contribute.
@Bhargav Rao: IMHO ahuetWL's qualification of jonatjano's "off-the-cuff" hint improved its precision.. or is 'lack of precision' not your point here?
@KieranRyan, the post was flagged as "Not An Answer" and there were a few comments related to the same, to which the OP (ahuetWL) had replied asking if it isn't an answer. My edit and subsequent comment was to affirm that it was an answer. I'm not sure about the technical correctness/precision of the answer itself. Let me know if you have any other concerns. Thanks
@BhargavRao Thanks Bhargav for the explanation.. I can confirm that running "yarn install" or "npm install" will realign your local installed dependencies with the project's package.json dependencies including @angular/cli assuming you've previously saved the install to package.json for example using "npm install --save-dev @angular/[email protected].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.