Bootstrapping fails: gyp does not want Python 3.7.4

I have cloned the repository and launched script/bootstrap. The first lines of the progress report say

Node: v10.15.2
Npm: v6.2.0
Installing script dependencies
Installing apm
apm 2.4.3
npm 6.2.0
node 10.2.1 x64
atom unknown
python 3.7.4
git 2.20.1

Additionally node-gyp -v is 6.1.0. Upon installing the modules, this error occurs


gyp ERR! configure error
gyp ERR! stack Error: Python executable “/mnt/sda2/lipari/s/atom/atom/apm/node_modules/atom-package-manager/bin/python-interceptor.sh” is v3.7.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

So basically node-gyp wants Python2, but I don’t know where exactly I should pass the --python switch as suggested. If I then go to node-gyp page at https://www.npmjs.com/package/node-gyp I pick this suggestion that

If node-gyp is called by way of npm , and you have multiple versions of Python installed, then you can set npm 's ‘python’ config key to the appropriate value:
$ npm config set python /path/to/executable/python

I then do npm config set python $(which python2) — check that the file ~/.npmrc returns “python=/usr/bin/python2” — for good measure . ~/.npmrc — to no avail. Same error bootstrapping.

How can I avoid this error and bootstrap atom successfully?
Working with Debian GNU/Linux 10 (buster)

Late addition: the full stdout+stderr is available from https://paste.ubuntu.com/p/CCWTnTX6Sd/

Hello.

This forum may not be the best place for your question.
The forum was asked to concentrate on core Atom cases.

I will however state one thought:
Consider making Python V2.7 temporarily the only entry in the system path variable.
Typing python --version in the terminal should point to the V2.7 variant.

Good luck.

Confused by what core cases may mean. A request for support is one that fits this description:

if you’ re using Atom and encountered a problem, bug issue or simply have a question. This includes issues with https://atom.io website as well

Why being unable to bootstrap Atom deviates from this expectation? Using npm and npm-gyp follows from the scripts provided by Atom; couldn’t the case I have proposed to be used to make that script more robust, for example? Wondering.
Thanks for the side tip.

I hear you.
@leedohm: It is your call to make.

In addition to this, the standard python in my system is already Python 2 as per python --version. There is no need to set a path variable either, for all I know.

To my understanding it is atom (bootstrap script) that picks up Python 3 and creates the compatibility issue with npm-gyp. This, at least, if I read the messages in the progress report well as per line 21 of https://paste.ubuntu.com/p/CCWTnTX6Sd/. And I ask support re the application of the suggestion in line 22 or anything to the same effect.

Still wondering. Thanks for elucidating, in case there are ears are to hear.

I am in error. You are not talking about script as in the add-on package. This should be a core issue if I look at:
https://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-linux

Mentions such as (but not limited to):
When the ATOM_DEV_RESOURCE_PATH environment variable is set correctly,...

Ensure node-gyp uses python2 (run npm config set python /usr/bin/python2 -g, use sudo if you didn't install node via nvm)

Though there is mention in issues too:
https://github.com/atom/atom/issues/17370

The mist has cleared. I was there too. script/bootstrap is the path of the script inside atom’s cloned repository.

  • I am one section before the first quote, namely Cloning and bootstrapping. I did not set that environment variable because I am not interested in Running in Development Mode.
  • I had already set that config parameter in ~/.npmrc, as per the last but one paragraph in the start post
  • That’s why I still wonder(ed) and asked for support from the more expert/experienced

It does not seem related to python and npm-gyp. May serve as inspiration for developers though. Out of my depths.