packager: electron-packager is not recognized as a cmdlet name (Windows)

I installed electron-packager, but I can not use it:

The term 'electron-packager' is not recognized as a cmdlet name......

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Install electron and electron-packager globally:

npm install -g electron electron-packager

This will install electron 1.4.15 and electron-packager 8.5.1 into your user folder, not in project folder:

C:\Users\Administrador\AppData\Roaming\npm

or it can be some Documents and Settings, anyway you dont have to bother about this folder and touch anything there.

Delete if present node_modules folder in your project folder. go in cmd. exe to your project folder:

electron-packager . --all --electron-version=1.4.15

Dont use PS, use cmd.exe

npm install electron-packager -g npm install electron-packager --save-dev

Install both locally as well as globally will solve the issue

npm install electron-packager -g

Installing it globally resolved my issue. Thanks!

I use “npm build”: “scripts”: { “start”: “electron .”, “build” : “electron-packager . --all” }

worked perfectly, I had followed tutorial videos (youtube) but it did not work, followed his steps worked! Thank you very much 😃

Can you send the exact error message in CMD

You should also install electron itself locally:

npm install electron --save-dev

It seems that you sytem path variable is dirty.

What is the output of $env:PSModulePath in PS, and are all paths well escaped and delimited

And why are you building from PS as admin, and not as local user from cmd or with .bat file, just curious?

I used devDependencies, not work Used npm install electron-packager --save-dev for install

Result: npm build screenshot (http://prntscr.com/e4m5ui)

My Package.json

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
	"build": "electron-packager . --all"
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^1.4.1",
    "electron-packager": "^8.5.1"
  }
}