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

188
Vistas
Create a npm package with dependencies

I have a distributed node.js project and I want to create a standalone package containing the project's domain.

First of all I created a package called "common" containing some utilities using the:

npm pack

command and creating the common.tgz file. Next I created the model.tgz file using the same method, please node that the model package use the common package so I installed it putting inside "model" in the temp folder, so the model package has the following structure:

|_ model
  |_ tmp
    |_common.tgz

It seems to work.

Now I want to import model.tgz inside my main project putting it into temp folder, but when I run the

npm i 

comand I get:

npm ERR! enoent ENOENT: no such file or directory, open 'prj_name/backend/functions/functions/tmp/common-1.0.0.tgz' npm ERR! enoent This is related to npm not being able to find a file.

I solved it by doing so in my main project:

|_ main
  |_ tmp
    |_model.tgz 
    |_tmp
      |_common.tgz

Since this is a little bit confusing, Is there a way to include common.tgz inside model.tgz and not need to re-import everywhere? Thanks.

almost 4 years ago · Santiago Trujillo
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