Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda