npm Community Forum (Archive)

The npm community forum has been discontinued.

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

Storing multiple NPM libraries/packages in one Git repo

I am trying to install an NPM library which is not stored at the root of a Git repo.

imagine I have 3 npm packages in this git repo


is there a way to install libA or libB or libC and reference them in a package.json dependencies list?

For example,

"dependencies": {
  "libB": ""

but when I tried that, it didn’t work. The error was:


I do not believe there is currently a way to install directly from subfolder on github.

(There is certainly interest in being able to: long locked thread and long closed thread, but be warned there is some unconstructive comments mixed in with the discussion.)

You do have other options, like publishing the modules to an npm repository, or installing from a local folder, or for development using npm link, and even combining into a script to npm install package from github repo subfolder by hand.