0

I am trying to stage dependencies from the NPM registry in a Nexus NPM proxy repository for any arbitrary JavaScript project. I can perform an npm install or yarn install which will cause all the dependencies to be staged, but I'd like to avoid that. The main reason is I want to avoid needing the necessary C/C++ libraries installed to compile the dependencies that are NodeJS C/C++ add-ons.

The only solution I can think of is by parsing the package-lock.json/yarn.lock file and running npm pack <dependency> for each dependency, which will cause npm to fetch the needed dependency and copy the tarball of the dependency to the current directory. I could then delete each downloaded tarball.

Is there a more elegant solution for either npm or yarn?

CoryCoolguy
  • 1,065
  • 8
  • 18
mprahl
  • 155
  • 1
  • 1
  • 5

1 Answers1

2

If you run npm install --ignore-scripts then the install scripts will be ignored and so any C/C++ files won't be built anymore.

Aplet123
  • 33,825
  • 1
  • 29
  • 55