cannot load file-dependencies of a tgz's dependencies

0

I have trouble to use a custom npm build I lib and put inside a tgz in another project, because of it files-dependencies

I want to bundle a custom lib npm and its files-dependencies inside a tgz.

the tgz:

->myLib.tgz/
--->myLib.js
--->package.json
--->node_modules/
--->libs/
------->lib1/
--------->lib1.js
--------->package.json
...

the package.json of myLib:(stored inside the tgz)

{
  name:myLib ,...
  dependencies:{
     lib1:"./libs/lib1/"
   }
 }

The issue, when I put myLib.tgz in a package.json of another project and do an npm install, I have this error:

Could not install "directoryWhereMyLibIs/myLib.tgz/libs/lib1" as it is not a directory and is not a file with a name ending in .tgz, .tar.gz or .tar

the package.json

{name:otherProject
dependencies:{myLib:"directoryWhereMyLibIs/myLib.tgz"}

}

what can I do?

(Reports to #bugs should use the template which includes extra information like the npm version you are running and platform you are on. Reports to #support are more freeform and I have moved your issue there.)

I am not sure whether this is a limitation or expected, someone with more familiarity with the local path support might have an answer.

I did see that local paths are not recommended for publishing: https://docs.npmjs.com/files/package.json#local-paths

This feature is helpful for local offline development and creating tests that require npm installing where you don’t want to hit an external server, but should not be used when publishing packages to the public registry.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.