Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
Install npm package programmatically after npm decision to drop programmatic API

Before npm 8.0 was possible to install npm packages programmatically, like this:

const npm = require('npm');
npm.load((error) => {
    if (error) return console.log(error);
    npm.commands.install([package], (error, data) => {
        if (error) return console.log(error);
        // command succeeded, and data might have some info
    });
    npm.on('log', (message) => {
        console.log(message);
    });
});

But they decided to refactor things and the support for programmatic API was dropped. Of course, there is the option to keep npm version bellow 7.24.2 which is the last supporting version, but some vulnerabilities were found in those versions and despite the fact that they are harmless in my case the console looks scarry for users.

Is there any reliable alternative to this issue?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!