electron-userland/electron-builder

sh: electron-builder: command not found

Closed this issue · 11 comments

  • Version:
    "electron-builder": "^22.9.1"
  • Electron Version:
    "electron": "^10.1.5",
  • Electron Type (current, beta, nightly):
  • Target:

Problem Description
When i executenpm run pack

    "build": "react-scripts build",
    "dev": "concurrently \"wait-on http://localhost:3000 && electron .\" \"cross-env BROWSER=none npm start\"",
    "pack": "electron-builder --dir",
    "dist": "electron-builder",
    "prepack": "npm run build"

He has the following error:
electron-builder错误

make sure you have installed the modele globally

At first try to install globally

npm i -g electron-builder

And try again.
If it doesn't work then use npx in package.json.

    "pack": "npx electron-builder --dir",

At first try to install globally

npm i -g electron-builder

And try again.
If it doesn't work then use npx in package.json.

    "pack": "npx electron-builder --dir",

at last it worked or not?

At first try to install globally

npm i -g electron-builder

And try again.
If it doesn't work then use npx in package.json.

    "pack": "npx electron-builder --dir",

at last it worked or not?

It should work. If electron-builder is not installed, npx will install and run it on the fly

At first try to install globally

npm i -g electron-builder

And try again.
If it doesn't work then use npx in package.json.

    "pack": "npx electron-builder --dir",

at last it worked or not?

It should work. If electron-builder is not installed, npx will install and run it on the fly

Then if it works
can this issue be closed now?

I don't know, I didn't create this issue)

On Sun, Nov 15, 2020, 2:34 PM AkashPattanaik @.***> wrote: At first try to install globally npm i -g electron-builder And try again. If it doesn't work then use npx in package.json. "pack": "npx electron-builder --dir", at last it worked or not? It should work. If electron-builder is not installed, npx will install and run it on the fly Then if it works can this issue be closed now?

oh
i thought its u so i was talking to you as the issue creator

@BLUE-DEVIL1134 I was able to do it yesterday, nothing has been changed, electron-builder has been installed long ago, I don’t know what the specific reason is, it’s very strange

@BLUE-DEVIL1134 I was able to do it yesterday, nothing has been changed, electron-builder has been installed long ago, I don’t know what the specific reason is, it’s very strange

as i said above install globally or as @utyfua said , use npx

stale commented

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

We're also getting this error (Command "electron-builder" not found) when trying to run electron-builder from within a package.json script ("electron:win-build": "yarn build:prod && electron-builder build --win --ia32"). Installing electron-builder globally in our case is NOT an acceptable solution (using CI infrastrukture). In particular, the electron-builder docs recommends installing the package locally (using yarn, see https://www.electron.build/#installation), providing the "runner" in the node_modules/.bin directory, which is searched for by yarn (and npm?) automatically. In my case, this problem occured on a win agent (with yarn v1.22.5) and after upgrading electron-builder from v22.8.1 -> v22.9.1, which caused the electron-builder runner missing in the node_modules/.bin directory after a clean yarn install (whereby I cannot exclude that the runner existing until then was an artifact of a previous update/install). Any help on this is very much appreciated.