vue-cli-plugin-electron-builder: macOS 12.3 (21E230) Exit code: ENOENT. spawn /usr/bin/python ENOENT

    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 +

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 28

Commits related to this issue

Most upvoted comments

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
foobar@1.0.0 /Users/me/Dev/foobar
└─┬ vue-cli-plugin-electron-builder@2.1.1
  └── electron-builder@23.0.3

Aaand build on mac os 12.3.1 works again 😃

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”.

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

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

https://github.com/electron-userland/electron-builder/issues/6726#issuecomment-1073262721

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

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
foobar@1.0.0 /Users/me/Dev/foobar
└─┬ vue-cli-plugin-electron-builder@2.1.1
  └── electron-builder@23.0.3

Aaand build on mac os 12.3.1 works again 😃

not working its update to 22.14.13

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 !

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也无效

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:

desktop@0.6.38 /Users/daniel/Documents/Projects/desktop
├── electron-builder@23.3.3 
└─┬ vue-cli-plugin-electron-builder@2.1.1
  └── electron-builder@22.14.13 

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.

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

Install python 2 first

$ which python

/path/to/python

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

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

    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