npm Community Forum (Archive)

The npm community forum has been discontinued.

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

npm.commands.install error "node-pre-gyp spawn ENOENT"

What I Wanted to Do

I’m installing packages programmatically inside electron. Code is as follow:

What Happened Instead

error “node-pre-gyp spawn ENOENT”

Reproduction Steps

  1. create a simple electron app
  2. use npm.commands.install(packagePath, packages, (err) => { to install for some dir, for example, packagePath can be ~/Desktop/somerepo, and package is ["sqlite3"] which needs node-pre-gyp


I think npm.commands.install is not handling node-pre-gyp properly.

Platform Info

$ npm 6.9.0 in package.json
node: electron 5.0.1 Nodejs 12.0.0