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

ng update fails when using local library #13059

Closed
15 tasks
elboukhari opened this issue Nov 27, 2018 · 22 comments
Closed
15 tasks

ng update fails when using local library #13059

elboukhari opened this issue Nov 27, 2018 · 22 comments

Comments

@elboukhari
Copy link

elboukhari commented Nov 27, 2018

Bug Report or Feature Request (mark with an x)

  • [X ] bug report -> please search issues before submitting
  • feature request
    Command (mark with an x)
  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • [x ] update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc
    Versions
    node --version : v10.13.0
    npm --version : 6.4.1
    ng --version :

`Angular CLI: 7.1.0
Node: 10.13.0
OS: linux x64
Angular: 7.1.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, http, language-service, material
... material-moment-adapter, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.11.0
@angular-devkit/build-angular 0.11.0
@angular-devkit/build-optimizer 0.11.0
@angular-devkit/build-webpack 0.11.0
@angular-devkit/core 7.1.0
@angular-devkit/schematics 7.1.0
@ngtools/webpack 7.1.0
@schematics/angular 7.1.0
@schematics/update 0.11.0
rxjs 6.3.3
typescript 3.1.6
webpack 4.26.1`

Repro steps
just type :
ng update

The log given by the failure
Not found : XXXXXX ()

In my package.json this library is declared as :

I'm still having the issue even with :
"@angular/cli": "7.1.0"

the error is the same as in the previous comment:
404 Not Found - GET https://registry.npmjs.org/XXXXXXX - Not found

Desired functionality
just ignore local libraries and update angular ones

Mention any other details that might be useful

@alan-agius4
Copy link
Collaborator

Hi, when you say local package? is it in a private npm repo? or using the file:// protocol?

@alan-agius4 alan-agius4 added needs: more info Reporter must clarify the issue comp: schematics/update labels Nov 27, 2018
@ngbot ngbot bot added this to the needsTriage milestone Nov 27, 2018
@elboukhari
Copy link
Author

it's file:// protocol, here is the corresponding line in package.json :

"MY-AWeSOME-LOCAL-LIB": "file:lib/MY-AWeSOME-LOCAL-LIB.tgz",

@meta72
Copy link

meta72 commented Nov 28, 2018

@alan-agius4 I have the same issue with a private npm repo. When I update any node module it says that it can't find my private module (which is on my private repo) on npmjs.org. This was working until cli version 7.0.7

@denisoby
Copy link

denisoby commented Nov 30, 2018

Fix previously described in this comment relates to another issue, sorry.
Thanks to @clydin who mentioned this. :)

@clydin
Copy link
Member

clydin commented Nov 30, 2018

That’s a different problem. Local packages; as well as git packages are not suppported by ‘ng update’ currently.

@elboukhari
Copy link
Author

Even with CLI 7.1.1 I still have the issue.

Here is my config:
`[08:41:18][~/Documents/devs/my-project/frontend]$ ng version

Angular CLI: 7.1.1
Node: 10.13.0
OS: linux x64
Angular: 7.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.11.0
@angular-devkit/build-angular 0.11.0
@angular-devkit/build-optimizer 0.11.0
@angular-devkit/build-webpack 0.11.0
@angular-devkit/core 7.1.0
@angular-devkit/schematics 7.1.1
@angular/cdk 7.1.0
@angular/material 7.1.0
@angular/material-moment-adapter 7.1.0
@ngtools/webpack 7.1.0
@schematics/angular 7.1.1
@schematics/update 0.11.1
rxjs 6.3.3
typescript 3.1.6
webpack 4.26.1

[08:41:24][~/Documents/devs/my-project/frontend]$ ng update
404 Not Found - GET https://registry.npmjs.org/xxx-xxx-xxx - Not found
`

@beleta
Copy link

beleta commented Dec 4, 2018

Same problem here.

$ ng update
404 Not Found - GET https://registry.npmjs.org/private-pkg - Not found

Where private-pkg is a package stored in a Nexus repository.

ng update worked in the same scenario with angular-cli before 7.1.0.

@JohnnyDevNull
Copy link

JohnnyDevNull commented Dec 12, 2018

Same problem here.

C:\git\my-app [upgrade-core-libs-and-angular +0 ~4 -0 !]> ng update @angular/cli

Result

404 Not Found - GET https://registry.npmjs.org/my-package - Not found

Where private-pkg is a package stored in a ProGet repository.

ng update worked in the same scenario with angular-cli in Angular 6

My private package has also a publishConfig set in the package.json:

  "publishConfig": {
    "registry": "https://proget.myserver.de/npm/MYFEED"
  },

@beleta
Copy link

beleta commented Dec 17, 2018

In latest release, 7.1.3, the problem seems that has been fixed.

@mgechev
Copy link
Member

mgechev commented Dec 17, 2018

@elboukhari would you try 7.1.3 and verify if the issue still persists?

@elboukhari
Copy link
Author

Hi @mgechev I still have the same issue even under 7.1.3 !
@beleta I'm curious how do you declare your local dependency in your package.json ?

[08:31:14][~/Documents/devs/my-project/frontend]$ ng version

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

Angular CLI: 7.1.3
Node: 10.13.0
OS: linux x64
Angular: 7.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.11.0
@angular-devkit/build-angular      0.11.0
@angular-devkit/build-optimizer    0.11.0
@angular-devkit/build-webpack      0.11.0
@angular-devkit/core               7.1.0
@angular-devkit/schematics         7.1.3
@angular/cdk                       7.1.0
@angular/cli                       7.1.3
@angular/material                  7.1.0
@angular/material-moment-adapter   7.1.0
@ngtools/webpack                   7.1.0
@schematics/angular                7.1.3
@schematics/update                 0.11.3
rxjs                               6.3.3
typescript                         3.1.6
webpack                            4.26.1
    
[08:31:46][~/Documents/devs/my-project/frontend]$ ng update
404 Not Found - GET http://registry.npmjs.org/MY-LIB - Not found

And here is the declaration of the lib in my package.json :

...
"dependencies": {
...
"MY-LIB": "file:lib/MY-LIB.tgz",
...
}
...

where "MY-LIB" is my local lib

@JohnnyDevNull
Copy link

JohnnyDevNull commented Dec 18, 2018

For me with ProGet Package the error also still exists with 7.1.3

EDIT:

The package is registered in the package-lock.json file as followed:

"@my/my-package": {
  "version": "7.1.2",
  "resolved": "https://proget.myserver.de/npm/MYFEED/@my/my-package/-/my-mypackage-7.1.2.tgz",
  "integrity": "sha1-GXeQ7XsDxhUAlCZMw0OYFCBrK0Y=",
  "requires": {
    "@aspnet/signalr": "^1.1.0",
    "tslib": "^1.9.0"
  }
},

Actually for a workaround i have to uninstall all my local repo packages then run ng update and then after that reinstall my local packages.

@kpaxton
Copy link

kpaxton commented Dec 19, 2018

I'm getting this on @angular packages with 7.1.3.
I'm on a closed network but have an npm registry mirror set up by my company at a different url.
When I run ng update I get 404 Not Found - GET https://registry.npmjs.org/@angular%2fcompiler-cli.

The package is different each time I run it but it's typically angular packages.

@beleta
Copy link

beleta commented Dec 20, 2018

Hi @mgechev I still have the same issue even under 7.1.3 !
@beleta I'm curious how do you declare your local dependency in your package.json ?

I am using a private npm repository and my dependencies are declared this way:

  "dependencies": {
    ...
    "carver-login": "0.0.3",
    "carver-validators": "0.0.1",
    ...
  },

@Kurt29
Copy link

Kurt29 commented Feb 21, 2019

This issue still exists in Version @angular/cli 7.3.2

@nsebs
Copy link

nsebs commented Mar 25, 2019

This is still happening with @angular/cli 7.3.6

$ ng update
Cannot read property '0.7.2' of undefined
$ ng version

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

Angular CLI: 7.3.6
Node: 8.11.4
OS: linux x64
Angular: 7.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.0
@angular-devkit/build-angular     0.13.0
@angular-devkit/build-optimizer   0.13.0
@angular-devkit/build-webpack     0.13.0
@angular-devkit/core              7.3.6
@angular-devkit/schematics        7.3.6
@angular/cdk                      7.3.1
@angular/cli                      7.3.6
@angular/material                 7.3.1
@ngtools/webpack                  7.3.0
@schematics/angular               7.3.6
@schematics/update                0.13.6
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.0

In package.json:

  "dependencies": {
    ...
    "my-custom-lib": "./libs/my-custom-lib-v0.7.2.tgz",
    ...
  }

@meta72
Copy link

meta72 commented May 23, 2019

For me this issue is fixed in version 7.3.9. I didn't test earlier versions. I am using a private npm repository (that had the same issue since version 7.0.7) for some node modules, not a local path.

$ ng version

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

Angular CLI: 7.3.9
Node: 10.15.3
OS: win32 x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.9
@angular-devkit/build-optimizer   0.13.9
@angular-devkit/build-webpack     0.13.9
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      7.3.9
@ngtools/webpack                  7.3.9
@schematics/angular               7.3.9
@schematics/update                0.13.9
rxjs                              6.5.2
typescript                        3.2.4
webpack                           4.29.0

@Kim-Andersen
Copy link

Tested in 8.0.3 and not working.

@meta72
Copy link

meta72 commented Jun 27, 2019

I recently updated from Angular 7.2.15 and angular-cli 7.3.9 to Angular 8.0.0 and angular-cli 8.0.2. I used ng update @angular/cli @angular/core and it worked. I then updated to Angular 8.0.3 and angular-cli 8.0.4, which also worked. I then updated some other module, just to see that ng update still works with angular-cli 8.0.4.

Disclaimer: I don't have a path to a file for my custom node modules. I have a private repository with my custom modules that also serves all modules from registry.npmjs.org.

@SergeyCherman
Copy link

I'm having the same issue with a local module that is being pointed to via a path. Upgrade from 6 to 7 worked fine so perhaps this is a regression?

@benelliott
Copy link

This drives me nuts every time there is a major version bump. Could there not be an option similar to allowDirty called ignoreUnresolvedPackages?

dgp1130 added a commit to dgp1130/angular-cli that referenced this issue Nov 13, 2019
…gular#13059)

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.
dgp1130 added a commit to dgp1130/angular-cli that referenced this issue Nov 13, 2019
Fixes angular#13059.

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.
dgp1130 added a commit to dgp1130/angular-cli that referenced this issue Nov 14, 2019
Fixes angular#13059.

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.
dgp1130 added a commit to dgp1130/angular-cli that referenced this issue Nov 18, 2019
Fixes angular#13059.

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.
dgp1130 added a commit to dgp1130/angular-cli that referenced this issue Nov 18, 2019
Fixes angular#13059.

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.
dgp1130 added a commit to dgp1130/angular-cli that referenced this issue Nov 19, 2019
Fixes angular#13059.

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.
dgp1130 added a commit that referenced this issue Nov 19, 2019
Fixes #13059.

Non-NPM dependencies in package.json are now filtered out of `ng update`. Dependencies which are linked as tarball or Git references will now be skipped during the update process.

(cherry picked from commit 74d6406)
@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 Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.