Dr. Slate
Dr. Slate

Reputation: 41

my NPM package is installed but not working?

I've installed the electron-builder npm package in my project via npm install --save-dev electron-builder and it successfully installed

Output from installing: up to date, audited 387 packages in 847ms

However, when I try to run any commands with electron-builder I get this error:

bash: electron-builder: command not found

Why is this? Do I need to install globally or something? why does the cli not work?

(Also I am using a mac if that matters)

Upvotes: 0

Views: 298

Answers (2)

Maxpan
Maxpan

Reputation: 559

You install electron-builder with --save-dev and it will install locally in your project.

You can write the script in package.json to use it, for example:

{
  "scripts": {
    "build": "electron-builder -x -x"
  }
}

Upvotes: 0

Joshua
Joshua

Reputation: 5322

You probably need to install electron-builder globally:

npm install -g electron-builder

Installing electron-builder with --save-dev means you can use electron-builder in NPM scripts, but only after installing with -g can you use electron-builder straight from the terminal.

Upvotes: 1

Related Questions