i have a problem if i try to install moment module in fuction node , here the log:
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to (https/Proxy registrY)/moment failed, reason: connect ETIMEDOUT 52.179.84.101:4873
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
In that case stop node-red and start it again in a command window using whatever method you normally use.
I presume, since you have not said, that you are not using Docker or Home Assistant.
node-red-stopnode-red-start are not windows things (these are service start/stop commands setup by the PI installer script) - forget about these for now.
Clearly the Node-RED server (backend part - not the front end browser you are using to access the node-red) cannot access the internet.
And this looks very wrong.
On windows, if you have not redirected output of node-red to a file, then there is no way to get the log. You can however simply start node-red in a command terminal under the correct account that _normally runs it (usually started by typing node-red into a command terminal) to see the output of node-red.
i put this to hide the registry, by the way i know how to run it, here below the full log hiding private url/name in bold
14 Dec 18:08:13 - [info] Node-RED version: v3.0.2
14 Dec 18:08:13 - [info] Node.js version: v16.14.2
14 Dec 18:08:13 - [info] Windows_NT 10.0.20348 x64 LE
14 Dec 18:08:13 - [warn] Use of editorTheme.palette.editable is DEPRECATED. Use externalModules.palette.allowInstall instead
14 Dec 18:08:15 - [info] Loading palette nodes
14 Dec 18:08:19 - [info] Settings file : C:\Users\riccardo.leuci.node-red\settings.js
14 Dec 18:08:19 - [info] Context store : 'default' [module=memory]
14 Dec 18:08:19 - [info] User directory : \Users\riccardo.leuci.node-red
14 Dec 18:08:19 - [warn] Projects disabled : editorTheme.projects.enabled=false
14 Dec 18:08:19 - [info] Flows file : \Users\ user i.node-red\flows.json
14 Dec 18:08:19 - [info] Server now running at http://127.0.0.1:1880/
14 Dec 18:08:19 - [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. ---------------------------------------------------------------------
14 Dec 18:08:19 - [info] Installing module: moment, version: latest
14 Dec 18:10:36 - [error] Installation of module moment failed:
14 Dec 18:10:52 - [error] ------------------------------------------
14 Dec 18:10:52 - [error] npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https: hide/ moment failed, reason: connect ETIMEDOUT 52.179.84.101:4873
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ user \AppData\Local\npm-cache_logs\2023-12-14T17_08_21_730Z-debug-0.log
14 Dec 18:10:52 - [error] ------------------------------------------
14 Dec 18:10:52 - [info] Failed to load external modules required by this flow:
14 Dec 18:10:52 - [info] - moment [unexpected_error]
So again, as you can see, Node-RED is not connecting to the internet.
And you state you computer that runs Node-RED does have internet access (or at least access to the NPM registry)?
Does the internet access require a proxy setting and if so, have you set HTTP_PROXY (and associated env vars) on the Node-RED server?
As a test, on the Node-RED server, can you ping npmjs.com? Can you cURL https://registry.npmjs.org/moment/-/moment-2.29.4.tgz --output C:\temp\moment.tgz (or in PS Invoke-WebRequest -Uri "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz" -OutFile "C:\temp\moment.tgz"
Yes, i mange to install moment module thank to tha registry
i did not set ny HTTPS proxy on node-red
yes
yes but here the resutl
`C:\Windows\system32>cURL https://registry.npmjs.org/moment/-/moment-2.29.4.tgz --output C:\temp\moment.tgzcURL https://registry.npmjs.org/moment/-/moment-2.29.4.tgz --output C:\temp\moment.tgz^Z
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file C:\temp\moment.tgzcURL: No such file or
Warning: directory
2 681k 2 17350 0 0 51716 0 0:00:13 --:--:-- 0:00:13 51946
curl: (23) Failure writing output to destination
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file C:\temp\moment.tgz: No such file or
Warning: directory
2 681k 2 14612 0 0 97538 0 0:00:07 --:--:-- 0:00:07 98067
curl: (23) Failure writing output to destination
C:\Windows\system32>cURL https://registry.npmjs.org/moment/-/moment-2.29.4.tgz --output C:\temp\moment.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file C:\temp\moment.tgz: No such file or
Warning: directory
2 681k 2 15981 0 0 72547 0 0:00:09 --:--:-- 0:00:09 72972
curl: (23) Failure writing output to destination
I'm sorry to not explain me well , but no resoloution yet.
When run node-red from CMD i still have that problem(even as admin ), the execution tries to install moment but fails as before