npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

cannot load file-dependencies of a tgz's dependencies


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:


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

  name:myLib ,...

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



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:

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.