Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

540
Vistas
.npmrc ignored private package

I am trying to use my first private npm package on a gitlab private instance

I added @ajouve:registry=https://gitlab.my-website.io/api/v4/packages/npm/ to .npmrc

the command npm get seems to return the correct config

; "project" config from /Volumes/Work/service/.npmrc

@ajouve:registry = "https://gitlab.my-website.io/api/v4/packages/npm/" 

; "cli" config from command line options

omit = [] 
user-agent = "npm/7.5.4 node/v12.18.1 darwin x64" 

; node bin location = /usr/local/bin/node
; cwd = /Volumes/Work/service
; HOME = /Users/ajouve
; Run `npm config ls -l` to show all defaults.

But when I want to add the package

npm install --save @ajouve/my-module

I have

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@ajouve/my-module Not found
npm ERR! 404 
npm ERR! 404  '@ajouve/my-module@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ajouve/.npm/_logs/2021-03-19T15_06_50_186Z-debug.log

It goes to https://registry.npmjs.org

Running npm config ls -l | grep registry

I have

metrics-registry = "https://registry.npmjs.org/"
registry = "https://registry.npmjs.org/"
@ajouve:registry = "https://gitlab.my-website.io/api/v4/packages/npm/"
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Instead of git://, use git+ssh://

npm i -S git+ssh://git@gitlab.com:<org>/<project>.git

Here you can get several answers

Install npm module from gitlab private repository

over 4 years ago · Santiago Trujillo Denunciar

0

As someone who started using Gitlab's registry a couple days ago, i ran on the same issue. On the .npmrc, the scope name has to meet with your packet scope. For example, if we have the project A, it's package.json should be like this:

{
"name": "@myscope/myproject",
...Rest of your package.json

And on your project B, the .npmrc must match the scope

@myscope:registry=https://gitlab.com/api/v4/packages/npm/

Then after, make sure you authenticate with the scoped registry, otherwise NPM will throw a error or ignore and go search on NPM Registry

$ npm config set @myscope:registry https://gitlab.com/api/v4/packages/npm/
$ npm config set -- '//gitlab.com/api/v4/packages/npm/:_authToken' "<your_token>"

NOTE: <your_token> should be a access token created on your Gitlab Profile. You can create this by going on Preferences > Access Tokens. Make sure to check "read_registry" before creating the token.

Then, you can install your package easily

$ npm install --save @myscope/myproject

EDIT: If you are using a self-hosted gitlab instance, it follows the same, just remember to change "gitlab.com" to your gitlab instance url.

over 4 years ago · Santiago Trujillo Denunciar

0

Try this, it should work.

npm install --save @ajouve/my-module --registry=https://gitlab.my-website.io/api/v4/packages/npm/ 

Another way is to create group endpoint in the private instance which will point hosted + proxy to public packages and update your registry to point to that endpoint so both private and public packages will work.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda