Skip to content

install npm package from github repo #1521

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
lechen26 opened this issue Jul 14, 2020 · 2 comments
Closed

install npm package from github repo #1521

lechen26 opened this issue Jul 14, 2020 · 2 comments
Labels
Release 6.x work is associated with a specific npm 6 release

Comments

@lechen26
Copy link

Hi

i have a repository of npm library which being used by other repos.
i want to be able to test this library properly before releasing a new release from specific branch.

i saw it is possible to install npm pacakge from github repository so i did the following:

  • updated the library-repo to include prepare script like this:
    "preapre": "npm run build"
  • updated one of the repository that using this library (repo1) on package.json with the following:
    "@org/library-repo": "github:org/library-repo#branch"
    (instead of "@org/library-repo": "0.0.1" )

when i do npm install on repo1 the package indeed installed but the library dependencies installed on the node_modules directory of the library , not on the local node_modules folder.
so when running the application, i get alot of 'cannot find module' errors as i require some of the transitive dependencies and do not directly exist.
copy the node_modules/@org/my-library-repo/node_modules into local node_modules solves this issue but it doesnt seems ideal.

what am i missing?
thanks!

@PenelopeFudd
Copy link

I had a problem like this, maybe it's the same thing:

$ git clone  git@github.com:iann0036/former2.git
$ cd former2/cli
$ former2   # command not found
$ npm install -g .
$ former2    # error (deepmerge.js not found)
$ npm install .
$ former2    # Works!

Apparently when you do 'npm install -g .' it doesn't run the "prepare" script; 'npm install .' does.
In this case, the prepare script is supposed to copy essential files from ../js/ into the current directory.

Ref: iann0036/former2#87

@darcyclarke darcyclarke added the Release 6.x work is associated with a specific npm 6 release label Oct 30, 2020
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Release 6.x work is associated with a specific npm 6 release
Projects
None yet
Development

No branches or pull requests

3 participants