The node package has been fixed for python3 but the npm package still has a dependency on python27.
Python 2.7 is end of life upstream and the FreeBSD package is due to expire on 31 December 2020.
Do you mean www/npm? I don't see it depends on python2. Could you explain more? Thanks!
(In reply to Li-Wen Hsu from comment #1)
Ah, www/node10 and www/node12 have USES=python2.7:build but www/node (14.5.0), www/npm, www/npm-node10 and www/npm-node12 depend on Python 3.
I am aware of this, and unfortunately upstream does not support Python 3 (yet) for building Node.js 10.x and 12.x.
Issue #1: The importance "Affects Only Me" should be increased on this issue.
Issue #2: "and unfortunately upstream does not support Python 3 (yet) for building Node.js 10.x and 12.x."
I did a little poking and the situation is a little more complex than that. I just built node10 (10.22.0) with python3.7 and it worked fine. I did so my modifying the port Makefile and changing the python version number. I was also able to 'npm install node-gyp' afterwards. There are however potential issues with *some* npm modules needing python27 to build.
Since python27 is officially EOL, I believe the correct course of action today is to update the port to use python3.
I'd like to add that i was able to successfully build SQLite with npm-node12, by making the following setting
npm config set python /usr/local/bin/python3
of course that is only one out of 17 million or so npm packages, so it's hard to say how confident we can be in this… LTS release of node
*** Bug 249789 has been marked as a duplicate of this bug. ***
*** Bug 249790 has been marked as a duplicate of this bug. ***
I will have another look at building www/node10 and www/node12 with Python 3.x. Node.js 10.x will be maintained until 2021-04-30, so it only makes sense to get it sorted.
Thanks for the info :)
Just changing the python version number in the ports' Makefile isn't enough, it seems. The Node.js configure shell script looks for python2.7, then python2, then falls back to python when trying to execute the configure.py script. Running python3 on configure.py results in numerous errors. I do not know Python, so it's hard for me to decipher what these errors mean.
For reference, here is the upstream issue opened for dropping Python2 support: https://github.com/nodejs/node/issues/32814. It appears that the discussion is leaning towards going away from a Python based build to something cmake based, but I doubt that will happen for the Node.js 10.x and 12.x release lines.
Oh, it's hard coded and I failed to delete the python 2.7 port, and so it worked for me. Bummer, sorry I wasted your time Bradley. Thanks for looking into it.
Expired port, will be removed soon.