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

ValueError: invalid mode: 'rU' while trying to load binding.gyp #236

Open
PuKoren opened this issue Feb 9, 2024 · 0 comments
Open

ValueError: invalid mode: 'rU' while trying to load binding.gyp #236

PuKoren opened this issue Feb 9, 2024 · 0 comments

Comments

@PuKoren
Copy link
Contributor

PuKoren commented Feb 9, 2024

This should be fixed in the next dependencies update (maybe to solve #235 when the upgrade to Meteor3 is ready?), so I am leaving this as a documentation ticket in case someone encounter the same problem. Please let me know if there is a better place for it or if it is already documented elsewhere.

Description

The following error is shown when starting the Meteor app using meteor --settings settings-dev.json on a system with Python 3.11 and above. It is due to an incompatibility between node-gyp and this specific version of Python.

line 234, in LoadOneBuildFile
   build_file_contents = open(build_file_path, 'rU').read()
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ValueError: invalid mode: 'rU' while trying to load binding.gyp
   gyp ERR! configure error 
   gyp ERR! stack Error: `gyp` failed with exit code: 1

How to solve it

Installing Python version 3.10 on the system (using pyenv for example) and forcing node-gyp to use it will solve it. If using pyenv, the path to Python can be provided to node-gyp by using the following command:

NODE_GYP_FORCE_PYTHON=~/.pyenv/versions/3.10.13/bin/python3 meteor --settings settings-dev.json

Sources

https://stackoverflow.com/questions/74715990/node-gyp-err-invalid-mode-ru-while-trying-to-load-binding-gyp

pact-foundation/pact-js#1087

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

1 participant