-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
python not found - had to configure it manually in npm #2654
Comments
Perhaps v12.3.1, not v12.13.1? Apple finally made good on its commitment to not bundle Python in the OS. I believe that you can just type Most Mac developers would |
Yes
python3 is actually there, not sure where it came from.
|
Can you run with logging enabled? The code should have attempted to try Lines 118 to 122 in 1206a82
|
@richardlau how do I enable logging? |
We'd be looking for, e.g. (from one of my Linux machines)
|
Ah yes, I understand what's the problem. On Mac it tries to install |
I'll post the output later. |
Here it is:
|
I believe that a bare bone macOS has a |
The built-in $ which python
python not found
$ which python3
/usr/bin/python3
$ /usr/bin/python3 --version
Python 3.8.9 The problem is that the node-gyp should properly detect that there is no |
For those using
This will add that config to Also I made sure to undo as much of the previous given solutions in the other files like: And finally I had to remove the Then when running |
|
Python 2 died 876 days ago on 1/1/2020 so it is no longer supported and @oscaredel must be relying on a very out-of-date release of node-gyp. |
@cclauss but |
That's correct. The problem is that by default we cannot install binary modules and the result is a very cryptic error for those not familiar with the project. The user experience is really degraded and a tiny fix in this library could improve it quite a lot. Specifically: Instead of using xcode-install to get the cli tools, we should check if python3 is available. |
Xcode command line tools does EDIT: The NOT is removed based on the evidence in replies below. |
Why are there no favorable reviews of #2660 so we can land it? |
@cclauss Calling |
Yes, can confirm I sometimes have to maintain some low-maintained older applications. I'm not very familiar with this stuff. Honestly, I don't even remember now what I was working on then. I just did a write-up for what worked should anybody else run into a similar error and land on this page. So feel free to ignore any of my comments if they seem dumb. |
|
I have a hard time finding a solution to this problem. It still seems to try to use @cclauss I saw a link to this PR #2362 but that does not seem to help me.
|
node-gyp found Python 3.10 and is happy to use it but... You need to edit |
@cclauss I installed pyenv and added Python 2.7. |
Python 2 died 1,058 days ago on 1/1/2020. Use it at your own risk. |
Run into today while setting up my new M1 Macbook. installed nodenv and that's what I get when attempting to install v12 node. Node v18 is already in place and it's been installed with no such issues.
I tried being smart and aliased
Note for you @cclauss - python3 came preinstalled with my system 13.0.1 (22A400) - I didn't have to do anything. |
Sorry. Node.js v12 is no longer supported https://github.com/nodejs/release#release-schedule |
Did you get to fix the issue @jacek213? |
@Noitham bumped node version in my app... nothing else worked for me |
@jacek213 Install pyenv, python 2.7. Set python 2.7 as global. |
Python 2 died 1,091 days ago on 1/1/2020. Using it without any security updates in all that time is just asking for trouble. |
For my case, it was better to make just symbolic link for python3 to python. it worked for me. Python3 was Installed using brew before.
|
The strong recommendation here is to create a |
This seems like it'll work, but for me it's failing because it looks for a very specific version of python:
Kind of silly, but I'll downgrade Python for now to get around it |
You are not running a current version of node-gyp |
this solution even working on ubuntu lts 20 |
@AI-Chef bad idea but it is your machine.
|
Instead of creating symlink and affecting other python projects, Create a venv in your current node project folder and do npm install again. |
On Mac OS X (Intel) v12.3.1 to make compilation of native modules work, I had to add the following to my
.npmrc
:It took me quite a bit of time to find this trick.
This is with:
Why is this needed?
Why can't node-gyp figure it out to try
python3
instead?Should we document this?
The text was updated successfully, but these errors were encountered: