"ng update" doesn't support private repos such as FontAwesome 5 Pro
Versions
Angular CLI: 6.0.0
Node: 9.11.1
OS: darwin x64
Angular: 6.0.0
... animations, cli, 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.6.0
@angular-devkit/build-angular 0.6.0
@angular-devkit/build-optimizer 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.0
@ngtools/webpack 6.0.0
@schematics/angular 0.6.0
@schematics/update 0.6.0
rxjs 6.1.0
typescript 2.7.2
webpack 4.6.0
Repro steps
- Add dependency on a private repo such as FontAwesome 5 Pro
- Run ng update @angular/core
Observed behavior
Not found : @fortawesome/pro-regular-svg-icons
Mention any other details that might be useful (optional)
This works fine using npm directly because the private repo has already been registered with npm
@Chklang did you try with ng update --registry https://privaterepo.mycompagnie.fr/npm/ ?
@aguacongas that works for me!
However, I shouldn't have to do that if the registry is declared in my .npmrc.
@kpaxton You're lucky, that doesn't for me. But my private repo needs authentication. And I agree, we shouldn't have to do that.
I also not lucky. I have also authentication set for my private registry and I am getting below error
Unable to authenticate, need: Basic realm="Artifactory Realm"
@Chklang did you try with
ng update --registry https://privaterepo.mycompagnie.fr/npm/?
Do you know what does ng update --registry https://privaterepo.mycompagnie.fr/npm/ command do? Users having auth set in their private registry can directly do what this command does?
In our npmrc we have options like strict-ssl and always-auth which are boolean values when being parsed. The update script in npm.ts tries to call 'replace' on the options and fails when the function does not exist (which it doesn't for bools):
options[key] = options[key].replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
We fixed this by checking if the function exists before trying to call it. PR is attached
Now, ng update works as expected also with our private Artifactory
Hi,
I had the same problem, because we are using Artifactory in our company. We store private repositories in it. So I had the same error when trying to use ng update.
But I can pass the parameter "-f" to force the update. I changed the names to give you an example what will happen with the force flag:
ng update @angular/cli -f
Package not installed: "-f". Skipping.
404 Not Found - Get https://registry.npmjs.org/@MYCORPORATE/MYREPO1 - Not Found
404 Not Found - Get https://registry.npmjs.org/@MYCORPORATE/MYREPO2 - Not Found
After that all was installed and update. I did this with the Angular and CDK package as well. We are updated the internal packages for our own.
I hope this will help.
PS: We also use https://www.npmjs.com/package/npm-check-updates with ncu command to check updates for our packages. This works well with Artifactory. So we now using ng update for all Angular related packages and ncu for other. But be careful and check if all new packages are working with the Angular packages.
@florian-kittel
Both npm and yarn have had the outdated option, check it out, it may satisfy your requirements.
Works on public and private npm repos.
Currently with 7.3.0 for me it works correctly again.
This should now be addressed in 7.3.0+. If anyone is still encountering problems, please open a new issue detailing the issue.
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.