In the instructions for installing on Windows, under " Installing Node.js Windows Build Tools" it gives two options. It says to use the second one "If you wish to have the built-in Python v2.7 install exposed for use". If the second one is not used, can that give to the problem seen in Facing problem in installing -node-arduino - #9 by binyameenaslam342 where the serialport install fails because it cannot find Python?
I don't use Windows, I am asking in order to help with that thread and this problem has appeared multiple times in the forum with different nodes pulling in the serialport.
That actually needs updating now because newer versions of Node.js for windows have the build tools included, the old npm package is now deprecated. All you need to do now is simply install node.js from the official executable on the website.
One of the reasons I don't like Python is because of the myriad different versions available on different platforms. It is confusing, there should be a single official source. This is especially true on Windows.
Is that the one linked to from the node red Installing on Windows page? https://nodejs.org/en/
If so, then do you know what may cause the missing python seen the linked thread?
I have taken delivery of a brand new Windows 11 desktop yesterday
(Last one was 10 years old!)
I've not installed NR on it even yet.
Got plenty of Arduinos
If you want to use me as a testbed - give me a shout and I'll follow your instructions (without deviation or alteration)
JFI It doesn't come with any version of python installed - if I type python in a cmd terminal - it jumps straight to offering Python 3.9 from the Windows app store
That would be great. I was just thinking of asking if anyone has a virgin windows VM they could try it on. I have extra RAM and larger SSD on my Xmas list which will give me enough to run VMs (under Ubuntu) but I can't at the moment.
I think the best thing to do would be to install as in the Running in Windows docs, Quick Start section. So not installing the build tools. Then see if node-red-node-arduino will install. @TotallyInformation thinks the build tools should be installed along with nodejs. If it fails with the missing python error (as in the thread I linked) then try to see if python is installed, and it is just that it is not in the path, or if it is not installed at all.
C:\Users\siwal>npm install -g --unsafe-perm node-red
C:\Users\siwal\AppData\Roaming\npm\node-red-pi -> C:\Users\siwal\AppData\Roaming\npm\node_modules\node-red\bin\node-red-pi
C:\Users\siwal\AppData\Roaming\npm\node-red -> C:\Users\siwal\AppData\Roaming\npm\node_modules\node-red\red.js
> bcrypt@5.0.1 install C:\Users\siwal\AppData\Roaming\npm\node_modules\node-red\node_modules\bcrypt
> node-pre-gyp install --fallback-to-build
[bcrypt] Success: "C:\Users\siwal\AppData\Roaming\npm\node_modules\node-red\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node" is installed via remote
+ node-red@2.1.4
added 295 packages from 374 contributors in 39.448s
then
C:\Users\siwal>node-red
2 Dec 17:49:52 - [info]
Welcome to Node-RED
===================
2 Dec 17:49:52 - [info] Node-RED version: v2.1.4
2 Dec 17:49:52 - [info] Node.js version: v14.18.2
2 Dec 17:49:52 - [info] Windows_NT 10.0.22000 x64 LE
2 Dec 17:49:52 - [info] Loading palette nodes
2 Dec 17:49:53 - [info] Settings file : C:\Users\siwal\.node-red\settings.js
2 Dec 17:49:53 - [info] Context store : 'default' [module=memory]
2 Dec 17:49:53 - [info] User directory : C:\Users\siwal\.node-red
2 Dec 17:49:53 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Dec 17:49:53 - [info] Flows file : C:\Users\siwal\.node-red\flows.json
2 Dec 17:49:53 - [info] Creating new flow file
2 Dec 17:49:53 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
2 Dec 17:49:53 - [info] Server now running at http://127.0.0.1:1880/
2 Dec 17:49:53 - [info] Starting flows
2 Dec 17:49:53 - [info] Started flows
Excellent. So the conclusion seems to be that we should tell users to select that box to install the tools, and remove the section in the docs about installing the build tools manually. Does that make sense?
In Quick Start > Install Node.js: Add note to say click the checkbox to install the build tools. Also to reboot after install of nodejs.
Remove the section 'Installing Node.js Windows Build Tools'. The package suggested in that section is no longer maintained as it has been superseded by the version that comes with nodejs.
Move the Notes section currently at the end of Installing Node.js Windows Build Tools up to the end of Quick Start. At least I think that is where it should go.
Unfortunately my primary broadband is down due to a falling tree taking out the fibre in a storm last weekend so I only have access via the phone at the moment. It could be another week before it is up again. Then I am away for two weeks so I probably won't be able to fork the docs and create a PR for several weeks. If someone would like to volunteer to do it before then that would be great. Otherwise I will do it when I can.
I have also just noticed that on the Supported Node Versions page, under Installing Node.js the 'Node provides guides' link does not lead anywhere helpful for Windows. The sentence 'If you are running on a ...' should be extended to include a link to the Windows guide for Windows users. In fact it should also say to use the Pi guide for Ubuntu and other Debian OSs.
It would be nice to know what to tell anyone who installs without ticking the tools checkbox how to later install the tools. Could you try re-running the nodejs install (without uninstalling it, initially) and see if it gives you the tools option again?
Hello @Colin .. i can confirm that re-running the windows nodejs v14.18.2 installer, you will be presented with 3 options .. to Change, Repair or Remove nodejs. If you click Change and click Next you can then choose to install the build tools.
It is also possible to install the libraries and Python manually of course. The libraries and C/C++ compiler are part of visual studio which has a component installer that is freely installable.
Much easier to do it via the node.js install of course.
I tick mark this too when I reinstalled nodejs but it did not work either. One single error because of any reason and you have to reinstall it again or do yourself a favour, move to Linux.