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

186
Views
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
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!