Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 12.3 (21E230) Exit code: ENOENT. spawn /usr/bin/python ENOENT #1701

Closed
ningkexin opened this issue Mar 18, 2022 · 28 comments
Closed

macOS 12.3 (21E230) Exit code: ENOENT. spawn /usr/bin/python ENOENT #1701

ningkexin opened this issue Mar 18, 2022 · 28 comments

Comments

@ningkexin
Copy link

ningkexin commented Mar 18, 2022

    at /Users/xxx/web/xxx/node_modules/builder-util/src/util.ts:133:18
    at exithandler (node:child_process:406:5)
    at ChildProcess.errorhandler (node:child_process:418:5)
    at ChildProcess.emit (node:events:526:28)
    at ChildProcess.emit (node:domain:475:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Please upgrade electron-builder 23.02 +

@hjMaGitHub
Copy link

我也遇到了,有解决办法了吗?

@hjMaGitHub
Copy link

Please ask is it solved

@lylyong
Copy link

lylyong commented Mar 20, 2022

how to upgrade electron-builder 23.02+ in vue-cli-plugin-electron-builder

@hjMaGitHub
Copy link

    at /Users/xxx/web/xxx/node_modules/builder-util/src/util.ts:133:18
    at exithandler (node:child_process:406:5)
    at ChildProcess.errorhandler (node:child_process:418:5)
    at ChildProcess.emit (node:events:526:28)
    at ChildProcess.emit (node:domain:475:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

请升级 electron-builder 23.02 +

Hello, it is already 23.0.2, but still reported an error, do you have any suggestions?
image

@lylyong
Copy link

lylyong commented Mar 20, 2022

    at /Users/xxx/web/xxx/node_modules/builder-util/src/util.ts:133:18
    at exithandler (node:child_process:406:5)
    at ChildProcess.errorhandler (node:child_process:418:5)
    at ChildProcess.emit (node:events:526:28)
    at ChildProcess.emit (node:domain:475:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

请升级 electron-builder 23.02 +

Hello, it is already 23.0.2, but still reported an error, do you have any suggestions?
image

looks,must upgrade electron-build in vue-cli-plugin-electron-builder

@mx1120
Copy link

mx1120 commented Mar 23, 2022

image

i'm also

@mx1120
Copy link

mx1120 commented Mar 23, 2022

我也遇到了,有解决办法了吗?

有解决办法么?

@btribouillet
Copy link

btribouillet commented Mar 23, 2022

vue-cli-plugin-electron-builder needs to update its electron-builder dependency to 23.0.3

electron-userland/electron-builder#6732 (comment)

@btribouillet
Copy link

If you use Yarn, you can use selective dependency resolutions to force that module to use the newer electron-builder.

electron-userland/electron-builder#6726 (comment)

  "resolutions": {
    "vue-cli-plugin-electron-builder/electron-builder": "^23.0.3"
  }

@JamesS-M
Copy link

+1 I'm also running into this issue.

@Camotubi
Copy link

As a workaround install python 2.7 with pyenv then set PYTHON_PATH when runinng npm run electron:build like this:

PYTHON_PATH=/Users/PUT_YOUR_USER_HERE/.pyenv/versions/2.7.18/bin/python npm run electron:build

@mx1120
Copy link

mx1120 commented Apr 2, 2022

Can author update the version of electron builder to 23.0.3 in dependency

@huzunjie
Copy link

huzunjie commented Apr 2, 2022

There is a simple solution 😂:

To install python 2.7, And get the installation path (for example: /XXX/versions/2.7/bin/python);

Open "YourProjectPath/node_modules/dmg-builder/out/dmg.js", find "/usr/bin/python", replace with "/XXX/versions/2.7/bin/python".

@mx1120
Copy link

mx1120 commented Apr 3, 2022

There is a simple solution 😂:

To install python 2.7, And get the installation path (for example: /XXX/versions/2.7/bin/python);

Open "YourProjectPath/node_modules/dmg-builder/out/dmg.js", find "/usr/bin/python", replace with "/XXX/versions/2.7/bin/python".

Support the m1pro version of python2.7 Where can I download it? I can't find it

@MarMun
Copy link

MarMun commented Apr 14, 2022

Temporary (and npm native) solution to this is npm overrides (requires npm >= v8):

package.json
{
 .
 .
 .
  "devDependencies": {
    "vue-cli-plugin-electron-builder": "^2.1.1"
  },
  "overrides": {
    "vue-cli-plugin-electron-builder": {
      "electron-builder": "^23.0.3"
    }
  }
}

After changing package.json, I did (there may be a less 'brutal' approach):

rm -rf node_modules
rm package-lock.json
npm install

result:

npm list electron-builder
[email protected] /Users/me/Dev/foobar
└─┬ [email protected]
  └── [email protected]

Aaand build on mac os 12.3.1 works again :-)

@Jayin
Copy link

Jayin commented Apr 15, 2022

+1

@mx1120
Copy link

mx1120 commented Apr 17, 2022

There is a simple solution 😂:

To install python 2.7, And get the installation path (for example: /XXX/versions/2.7/bin/python);

Open "YourProjectPath/node_modules/dmg-builder/out/dmg.js", find "/usr/bin/python", replace with "/XXX/versions/2.7/bin/python".

The problem has been solved. Thank you very much !

@peteyan
Copy link

peteyan commented May 12, 2022

There is a simple solution 😂:

To install python 2.7, And get the installation path (for example: /XXX/versions/2.7/bin/python);

Open "YourProjectPath/node_modules/dmg-builder/out/dmg.js", find "/usr/bin/python", replace with "/XXX/versions/2.7/bin/python".

就这个最有用,那个改PYTHON_PATH也无效

@brenthmiras
Copy link

Install python 2 first

$ which python

/path/to/python

$ PYTHON_PATH=/path/to/python electron-builder ...

@billmorgan123
Copy link

Temporary (and npm native) solution to this is npm overrides:

package.json
{
 .
 .
 .
  "devDependencies": {
    "vue-cli-plugin-electron-builder": "^2.1.1"
  },
  "overrides": {
    "vue-cli-plugin-electron-builder": {
      "electron-builder": "^23.0.3"
    }
  }
}

After changing package.json, I did (there may be a less 'brutal' approach):

rm -rf node_modules
rm package-lock.json
npm install

result:

npm list electron-builder
[email protected] /Users/me/Dev/foobar
└─┬ [email protected]
  └── [email protected]

Aaand build on mac os 12.3.1 works again :-)

not working its update to 22.14.13

@do-web
Copy link

do-web commented Aug 20, 2022

Any other workaround here?

@MatthijsBurgh
Copy link
Collaborator

The current master branch uses electron-builder 23. So you could use that instead of the released version.

@MarMun
Copy link

MarMun commented Sep 1, 2022

not working its update to 22.14.13

@do-web @billmorgan123 Did you delete package-lock.json before npm install?

Unsure if npm overrides actually overrules package-lock.

@danline
Copy link

danline commented Sep 13, 2022

not working its update to 22.14.13

@do-web @billmorgan123 Did you delete package-lock.json before npm install?

Unsure if npm overrides actually overrules package-lock.

@MarMun - I did delete package-lock before running npm install. Pretty much followed this:

rm -rf node_modules
rm package-lock.json
npm install

Still what I am seeing is this:

[email protected] /Users/daniel/Documents/Projects/desktop
├── [email protected] 
└─┬ [email protected]
  └── [email protected] 

Any help will be greatly appreciated!

@danline
Copy link

danline commented Sep 14, 2022

not working its update to 22.14.13

@do-web @billmorgan123 Did you delete package-lock.json before npm install?
Unsure if npm overrides actually overrules package-lock.

@MarMun - I did delete package-lock before running npm install. Pretty much followed this:

rm -rf node_modules
rm package-lock.json
npm install

Still what I am seeing is this:

[email protected] /Users/daniel/Documents/Projects/desktop
├── [email protected] 
└─┬ [email protected]
  └── [email protected] 

Any help will be greatly appreciated!

Never mind. My npm was out of date. I was still using npm v 6.14.8 which doesn't support overrides. Updating npm to the latest version resolved this.

@MarMun
Copy link

MarMun commented Sep 15, 2022

@danline Ah yes. Overrides require >= npm 8. Should have mentioned this. Sorry for the confusion.

@tkarnaAWS
Copy link

There is a simple solution 😂:

To install python 2.7, And get the installation path (for example: /XXX/versions/2.7/bin/python);

Open "YourProjectPath/node_modules/dmg-builder/out/dmg.js", find "/usr/bin/python", replace with "/XXX/versions/2.7/bin/python".

It worked! Thanks a lot

@GerryDush
Copy link

overrides

这方法解决了我的问题👍

undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Jul 31, 2023
The GitHub-hosted runners began experiencing issues while building macOS
desktop distributions, exclusively affecting the macOS environment.
The Ubuntu and Windows environments remained unaffected.

The logs highlighted the absence of Python in the macOS environment, which
resulted in build failure:

```sh
  Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
```

Since the `electron-builder` package uses Python scripts to create DMG
disk images for macOS distributions, Python is needed for building the
application. However, electron-builder uses Python 2.X meanwhile modern
macOS versions have removed Python 2.X from the operating system on
default installation.

Although this issue was resolved in `electron-builder` version 23,,
`vue-cli-plugin-electron-builder` continues to use version 22. Due to a
lack of maintenance, the package is unlikely to receive updates.

This commit forces `vue-cli-plugin-electron-builder` to use the latest
`electron-builder` which resolves the macOS distribution build failure.

In CI process, GitHub-hosted runners start to fail when building macOS
desktop distributions. It is only observered in the macOS environment
while the application is built successfully in both the Ubuntu and
Windows environments.

The error message in the logs indicated that Python was not found in the
macOS environment:

```sh
Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
```

`electron-builder` package uses Python scripts for certain operations,
specifically for creating DMG disk images for macOS distributions. As a
result, Python is a necessary dependency when building the application
for macOS.

`electron-builder` has fixed this starting from version 23, but
vue-cli-plugin-electron-builder still refers to version 22 and it is
unmaintained and not likely to get updates.

The solution is to add a step in the GitHub Actions workflow to set up
Python in the macOS environment. `actions/setup-python` sets up the
Python environment in the runner if the OS is macOS.

This change does not impact the Ubuntu and Windows environments as the
setup-python step is conditionally executed only for macOS. The addition
of Python to the macOS environment in CI process has resolved the build
failure issue for the macOS distribution.

See also:

- electron-userland/electron-builder#6606
- electron-userland/electron-builder#6726
- electron-userland/electron-builder#6732
- nklayman/vue-cli-plugin-electron-builder#1691
- nklayman/vue-cli-plugin-electron-builder#1701
zqhong added a commit to zqhong/BilibiliVideoDownload that referenced this issue Aug 13, 2023
LarrMarburger added a commit to LarrMarburger/privacy.sexy that referenced this issue Nov 16, 2023
The GitHub-hosted runners began experiencing issues while building macOS
desktop distributions, exclusively affecting the macOS environment.
The Ubuntu and Windows environments remained unaffected.

The logs highlighted the absence of Python in the macOS environment, which
resulted in build failure:

```sh
  Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
```

Since the `electron-builder` package uses Python scripts to create DMG
disk images for macOS distributions, Python is needed for building the
application. However, electron-builder uses Python 2.X meanwhile modern
macOS versions have removed Python 2.X from the operating system on
default installation.

Although this issue was resolved in `electron-builder` version 23,,
`vue-cli-plugin-electron-builder` continues to use version 22. Due to a
lack of maintenance, the package is unlikely to receive updates.

This commit forces `vue-cli-plugin-electron-builder` to use the latest
`electron-builder` which resolves the macOS distribution build failure.

In CI process, GitHub-hosted runners start to fail when building macOS
desktop distributions. It is only observered in the macOS environment
while the application is built successfully in both the Ubuntu and
Windows environments.

The error message in the logs indicated that Python was not found in the
macOS environment:

```sh
Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
```

`electron-builder` package uses Python scripts for certain operations,
specifically for creating DMG disk images for macOS distributions. As a
result, Python is a necessary dependency when building the application
for macOS.

`electron-builder` has fixed this starting from version 23, but
vue-cli-plugin-electron-builder still refers to version 22 and it is
unmaintained and not likely to get updates.

The solution is to add a step in the GitHub Actions workflow to set up
Python in the macOS environment. `actions/setup-python` sets up the
Python environment in the runner if the OS is macOS.

This change does not impact the Ubuntu and Windows environments as the
setup-python step is conditionally executed only for macOS. The addition
of Python to the macOS environment in CI process has resolved the build
failure issue for the macOS distribution.

See also:

- electron-userland/electron-builder#6606
- electron-userland/electron-builder#6726
- electron-userland/electron-builder#6732
- nklayman/vue-cli-plugin-electron-builder#1691
- nklayman/vue-cli-plugin-electron-builder#1701
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests