Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

536
Views
.npmrc ignoró el paquete privado

Estoy tratando de usar mi primer paquete npm privado en una instancia privada de gitlab

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

el comando npm get parece devolver la configuración correcta

 ; "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.

Pero cuando quiero agregar el paquete

npm install --save @ajouve/my-module

tengo

 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

Va a https://registry.npmjs.org

Ejecutando npm config ls -l | grep registry

tengo

 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 answers
Answer question

0

En lugar de git://, usa git+ssh://

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

Aquí puedes obtener varias respuestas.

Instale el módulo npm desde el repositorio privado de gitlab

over 4 years ago · Santiago Trujillo Report

0

Como alguien que comenzó a usar el registro de Gitlab hace un par de días, me encontré con el mismo problema. En .npmrc, el nombre del alcance debe coincidir con el alcance de su paquete. Por ejemplo, si tenemos el proyecto A, su paquete.json debería ser así:

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

Y en su proyecto B, el .npmrc debe coincidir con el alcance

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

Luego, asegúrese de autenticarse con el registro de alcance, de lo contrario, NPM arrojará un error o lo ignorará y buscará en el Registro de NPM.

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

NOTA: <su_token> debe ser un token de acceso creado en su perfil de Gitlab. Puede crear esto yendo a Preferencias > Tokens de acceso. Asegúrese de verificar "read_registry" antes de crear el token.

Luego, puede instalar su paquete fácilmente

 $ npm install --save @myscope/myproject

EDITAR: si está utilizando una instancia de gitlab autohospedada, sigue lo mismo, solo recuerde cambiar "gitlab.com" a la URL de su instancia de gitlab.

over 4 years ago · Santiago Trujillo Report

0

Prueba esto, debería funcionar.

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

Otra forma es crear un punto final de grupo en la instancia privada que apuntará el proxy alojado + a los paquetes públicos y actualizará su registro para apuntar a ese punto final para que funcionen tanto los paquetes privados como los públicos.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!