angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Angular CLI 8.3.19 ng update install temp cli

Open lneumeier opened this issue 7 years ago • 8 comments

🐞 Bug report

Command (mark with an x)

  • [ ] new
  • [ ] build
  • [ ] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [x] update
  • [ ] lint
  • [ ] xi18n
  • [ ] run
  • [ ] config
  • [ ] help
  • [ ] version
  • [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 8.3.17 or 8.3.18

Description

Running

ng update

installs the latest angular-cli into a temp directory despite the fact, that the global installed angular-cli version is already installed. Why not use the global one?

logs:

ng update
Your global Angular CLI version (8.3.19) is greater than your local
version (8.3.18). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The installed Angular CLI version is older than the latest published version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.

> @angular/[email protected] postinstall /private/var/folders/cy/4hs_g4mj4jlg6nyk_9vyxg9w0000gn/T/.ng-temp-packages-rFmoyk/node_modules/@angular/cli
> node ./bin/postinstall/script.js

npm WARN saveError ENOENT: no such file or directory, open '/private/var/folders/cy/4hs_g4mj4jlg6nyk_9vyxg9w0000gn/T/.ng-temp-packages-rFmoyk/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/cy/4hs_g4mj4jlg6nyk_9vyxg9w0000gn/T/.ng-temp-packages-rFmoyk/package.json'
npm WARN .ng-temp-packages-rFmoyk No description
npm WARN .ng-temp-packages-rFmoyk No repository field.
npm WARN .ng-temp-packages-rFmoyk No README data
npm WARN .ng-temp-packages-rFmoyk No license field.

After that running

ng update @angular/cli @angular/core

another temp install happens.

lneumeier avatar Nov 16 '19 19:11 lneumeier

I am also getting the same error.

ErVishalM avatar Nov 18 '19 11:11 ErVishalM

I'm not sure that it is related, but whatever I do, after running ng update [...] it breaks my global install by not reverting to the old one. Meaning if I write which ng after, it returns ng not found. This happens 100% of the times and I can reproduce it just by making the git repository dirty which will cause ng to then tell me to commit any changes before proceeding, and then it quits. After this though ng is no longer symlinked properly.

Reverting to 8.3.18 seems to fix the breakage at least.

simpers avatar Nov 20 '19 13:11 simpers

@simpers, can you kindly provide the output of the below commands:

ng config cli.packageManager
ng version

Before running ng update that causes the "global" ng to be broken.

Thanks before hand.

alan-agius4 avatar Nov 20 '19 14:11 alan-agius4

similar issue here

Apples-MBP:~ apple$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.19
Node: 12.13.1
OS: darwin x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.19
@angular-devkit/core         8.3.19
@angular-devkit/schematics   8.3.19
@schematics/angular          8.3.19
@schematics/update           0.803.19
rxjs                         6.4.0
    
Apples-MBP:~ apple$ ng update --next
The installed Angular CLI version is older than the latest pre-release version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.

> @angular/[email protected] postinstall /private/var/folders/wn/rhw2jbyj36sc1f8ny_wljrp80000gn/T/.ng-temp-packages-ATJMBk/node_modules/@angular/cli
> node ./bin/postinstall/script.js

npm WARN saveError ENOENT: no such file or directory, open '/private/var/folders/wn/rhw2jbyj36sc1f8ny_wljrp80000gn/T/.ng-temp-packages-ATJMBk/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/wn/rhw2jbyj36sc1f8ny_wljrp80000gn/T/.ng-temp-packages-ATJMBk/package.json'
npm WARN .ng-temp-packages-ATJMBk No description
npm WARN .ng-temp-packages-ATJMBk No repository field.
npm WARN .ng-temp-packages-ATJMBk No README data
npm WARN .ng-temp-packages-ATJMBk No license field.

+ @angular/[email protected]
added 260 packages from 206 contributors and audited 2883 packages in 48.36s
found 0 vulnerabilities

Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 0 dependencies.
Could not find a package.json. Are you in a Node project?
Apples-MBP:~ apple$ 

JOELJOSEPHCHALAKUDY avatar Nov 23 '19 13:11 JOELJOSEPHCHALAKUDY

running the command ng update --next from a project folder

Apples-MBP:store apple$ ng update --next
The installed Angular CLI version is older than the latest pre-release version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.

> @angular/[email protected] postinstall /private/var/folders/wn/rhw2jbyj36sc1f8ny_wljrp80000gn/T/.ng-temp-packages-8ChznA/node_modules/@angular/cli
> node ./bin/postinstall/script.js

npm WARN saveError ENOENT: no such file or directory, open '/private/var/folders/wn/rhw2jbyj36sc1f8ny_wljrp80000gn/T/.ng-temp-packages-8ChznA/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/wn/rhw2jbyj36sc1f8ny_wljrp80000gn/T/.ng-temp-packages-8ChznA/package.json'
npm WARN .ng-temp-packages-8ChznA No description
npm WARN .ng-temp-packages-8ChznA No repository field.
npm WARN .ng-temp-packages-8ChznA No README data
npm WARN .ng-temp-packages-8ChznA No license field.

+ @angular/[email protected]
added 260 packages from 206 contributors and audited 2883 packages in 47.466s
found 0 vulnerabilities

Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 30 dependencies.
    We analyzed your package.json, there are some packages to update:
    
      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       8.3.19 -> 9.0.0-rc.3     ng update @angular/cli --next
      @angular/core                      8.2.14 -> 9.0.0-rc.3     ng update @angular/core --next
Apples-MBP:store apple$ 

JOELJOSEPHCHALAKUDY avatar Nov 23 '19 13:11 JOELJOSEPHCHALAKUDY

@alan-agius4 Now though I cannot seem to reproduce any of it. It managed to get it all working by nuking everything (I initially got this problem in a repository that when clean couldn't update its dependencies due to incompatible versions between @angular and third-party npm-packages).

I do use yarn as my package manager though, but I get this:

$ ng config cli.packageManager
Value cannot be found.

Is it meant to be configured to use yarn globally or something? When tunning ng update it seems to use yarn, so I guess it might resolve that through the yarn.lock as we have no lock-file for npm? Either way, disregard the case I mentioned for now. If I find a way to reproduce it once more I'll post it.

simpers avatar Nov 25 '19 12:11 simpers

@simpers, sorry for my late reply. To accesses the global configuration you need to use the --global argument.

ng config cli.packageManager --global

I am closing the issue for now, since there doesn't seem to be a reproduction. If the problem persists, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

alan-agius4 avatar May 25 '20 07:05 alan-agius4

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.