1

Just migrated to Node 4.1.2 from 0.10. One of the packages being installed via npm install errors due to node-gyp having a problem with one of its dependencies, it's quite a few versions out of date. The issue has been brought up on the repo but hasn't seen activity since May. Is there a way to tell NPM to install this package but with the outdated dependency using a newer version?

EDIT: I've copied over an installed version from node_modules in an older project. npm install -g npm-check-updates then ncu in the node_modules/bs-html-injector/ directory. It lists updates, ncu -u will update the package.json, npm install after. I run my gulp task and html is injecting fine, all seems fine :) Would still like to know how to do this if I didn't have a local copy installed by NPM. It looks like it's just a 1:1 copy from the github repo?

4
  • I'm not sure how to target it via NPM though? Have not published a package before and only ever used npm in CLI pointing to the package name. Commented Oct 8, 2015 at 10:27
  • Just fork the repo. Then edit it to change the dependency. Then include the forked repo in your project. npm will then do the right things. Commented Oct 8, 2015 at 13:21
  • 1
    @Brennan npm lets you install packages from GitHub directly: npm install user/repo#branch. You can use your fork on GitHub this way until PR is merged. docs.npmjs.com/cli/install Commented Oct 8, 2015 at 22:24
  • @eush77 Cheers, for the command and doc link. Feel free to make that an answer and I'll accept it :) Commented Oct 9, 2015 at 9:39

2 Answers 2

3

With npm, you can install packages from GitHub directly:

npm install user/repo#branch 

You can fork the package on GitHub, make and propose the changes you need and use your fork as a dependency in your project until PR is merged.

Sign up to request clarification or add additional context in comments.

Comments

0

you can use --force to force install it

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.