Search code examples
linuxbashnpmartifactoryoraclelinux

npm command returning 406 Not Acceptable with custom registry


We are having a custom artifcatory repo for npm as I can't directly access https://registry.npmjs.org/ from our lab.

[user1@amsai0000000054 ~]$ npm config set registry=https://artifacts.xyz.com/artifactory/npm-remote/
[user1@amsai0000000054 ~]$ npm config get registry
https://artifacts.xyz.com/artifactory/npm-remote/

[user1@amsai0000000054 ~]$ npm view angular
npm ERR! code E406
npm ERR! 406 Not Acceptable - GET https://artifacts.xyz.com/artifactory/npm-remote/angular/

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user1/.npm/_logs/2021-08-04T15_12_22_598Z-debug.log
[user1@amsai0000000054 ~]$

Any ideas what could be the wrong here?


Solution

  • The issue seems to be related to the registry URL being passed. The registry should be set as

    npm config set registry=https://artifacts.xyz.com/artifactory/api/npm/npm-remote/

    Kindly refer to the below articles on more understanding,

    1. NPM registry
    2. NPM registry screencast