Install node-red on windows 10

Dear All,
im trying to install node-red on windows 10 machine, i try with two version on node-js 18.13.0 and 10.15.0 both x64 . when i run the npm install -g unsafe-perm node-red on with node-js 18.13 the error is E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/unsafe-perm - Not found

while if i try it on node-js version i recive a timeout error..

how can i install node-red on windows 10 machine?

Thanks in advance!

npm install -g --unsafe-perm node-red

PS C:\WINDOWS\system32> npm install -g unsafe-perm node-red
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/unsafe-perm - Not found
npm ERR! 404
npm ERR! 404 'unsafe-perm@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

It is npm install -g --unsafe-perm node-red
NOT npm install -g unsafe-perm node-red

As Julian wrote and as written in official docs: Running on Windows : Node-RED

PS C:\WINDOWS\system32> npm install -g --unsafe-perm node-red
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
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\cadarache\AppData\Local\npm-cache_logs\2023-03-10T13_09_34_099Z-debug-0.log

Is this a work machine by any chance? Or are you on a controlled network?

If not, reboot and try again.

this is a rok machine, i use it to surf othe internet and there isn't a particulare software...
After reboot the problem is the same

OK, can you - from a command line - create a new folder and in it run:

mkdir newfldr
cd newfldr
npm init -y
npm install aaa

That should install the dummy aaa package into the folder. If that works then in the same folder do:

npm install node-red

e.g. no -g so that it installs locally not centrally.

If that works, then we know that npm and node.js is ok and we can focus on the -g part and whether that is the issue.

C:\newfldr> npm init -y
Wrote to C:\newfldr\package.json:

{
"name": "newfldr",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": ,
"author": "",
"license": "ISC"
}

PS C:\newfldr> npm install aaa
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: The npm registry is deprecating TLS 1.0 and TLS 1.1 - The GitHub Blog
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: The npm registry is deprecating TLS 1.0 and TLS 1.1 - The GitHub Blog

added 1 package in 3s
PS C:\newfldr> npm install -g --unsafe-perm node-red
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
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\cadarache\AppData\Local\npm-cache_logs\2023-03-13T08_09_13_369Z-debug-0.log

What version of nodejs are you using?

Try setting npm to use https

npm set registry=https://registry.npmjs.org/

im using node js 18.13.0

PS C:\newfldr> npm set registry=https://registry.npmjs.org/
PS C:\newfldr> npm install -g --unsafe-perm node-red
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
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\cadarache\AppData\Local\npm-cache_logs\2023-03-13T08_58_14_293Z-debug-0.log

Are you behind a proxy?

Are you in a work place or home environment?

What does entering npm config ls -l show?

this pc is not behind a proxy.. surfing through a simple 4g ​​router

; "default" config from default values

_auth = (protected)
access = null
all = false
allow-same-version = false
also = null
audit = true
audit-level = null
auth-type = "web"
before = null
bin-links = true
browser = null
ca = null
cache = "C:\Users\cadarache\AppData\Local\npm-cache"
cache-max = null
cache-min = 0
cafile = null
call = ""
cert = null
ci-name = null
cidr = null
color = true
commit-hooks = true
depth = null
description = true
dev = false
diff =
diff-dst-prefix = "b/"
diff-ignore-all-space = false
diff-name-only = false
diff-no-prefix = false
diff-src-prefix = "a/"
diff-text = false
diff-unified = 3
dry-run = false
editor = "C:\WINDOWS\notepad.exe"
engine-strict = false
; fetch-retries = 2 ; overridden by user
fetch-retry-factor = 10
; fetch-retry-maxtimeout = 60000 ; overridden by user
; fetch-retry-mintimeout = 10000 ; overridden by user
; fetch-timeout = 300000 ; overridden by user
force = false
foreground-scripts = false
format-package-lock = true
fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "C:\Users\cadarache\AppData\Roaming\npm\etc\npmrc"
heading = "npm"
https-proxy = null
if-present = false
ignore-scripts = false
include =
include-staged = false
include-workspace-root = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "C:\Users\cadarache\.npm-init.js"
init-version = "1.0.0"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.license = "ISC"
init.module = "C:\Users\cadarache\.npm-init.js"
init.version = "1.0.0"
install-links = false
install-strategy = "hoisted"
json = false
key = null
legacy-bundling = false
legacy-peer-deps = false
link = false
local-address = null
location = "user"
lockfile-version = null
loglevel = "notice"
logs-dir = null
logs-max = 10
; long = false ; overridden by cli
maxsockets = 15
message = "%s"
metrics-registry = "https://registry.npmjs.org/"
node-options = null
noproxy = [""]
offline = false
omit =
omit-lockfile-registry-resolved = false
only = null
optional = null
otp = null
pack-destination = "."
package =
package-lock = true
package-lock-only = false
parseable = false
prefer-offline = false
prefer-online = false
; prefix = "C:\Program Files\nodejs" ; overridden by builtin
preid = ""
production = null
progress = true
provenance = false
proxy = null
read-only = false
rebuild-bundle = true
; registry = "https://registry.npmjs.org/" ; overridden by user
replace-registry-host = "npmjs"
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-peer = false
save-prefix = "^"
save-prod = false
scope = ""
script-shell = null
searchexclude = ""
searchlimit = 20
searchopts = ""
searchstaleness = 900
shell = "C:\WINDOWS\system32\cmd.exe"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
strict-peer-deps = false
strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "C:\Users\CADARA~1\AppData\Local\Temp"
umask = 0
unicode = false
update-notifier = true
usage = false
user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}"
userconfig = "C:\Users\cadarache\.npmrc"
version = false
versions = false
viewer = "browser"
which = null
workspace =
workspaces = null
workspaces-update = true
yes = null

; "builtin" config from C:\Users\cadarache\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\Users\cadarache\AppData\Roaming\npm"

; "user" config from C:\Users\cadarache.npmrc

fetch-retries = 5
fetch-retry-maxtimeout = 1400000
fetch-retry-mintimeout = 900000
fetch-timeout = 1800000
registry = "https://registry.npmjs.org/"

; "cli" config from command line options

long = true

How is the computer connected to this 4g router? Wifi? Ethernet? USB?

Can you ping an external address from your command line? try :
ping 1.1.1.1
ping google.com

What do you see if you enter ECHO %HTTP_PROXY% %HTTPS_PROXY% %NO_PROXY%

PS C:\newfldr> ECHO %HTTP_PROZY% %HTTPS_PROXY% %NO_PROXY%
%HTTP_PROZY%
%HTTPS_PROXY%
%NO_PROXY%
PS C:\newfldr> ping google.it

Esecuzione di Ping google.it [142.250.179.99] con 32 byte di dati:
Risposta da 142.250.179.99: byte=32 durata=55ms TTL=114
Risposta da 142.250.179.99: byte=32 durata=42ms TTL=114

Statistiche Ping per 142.250.179.99:
Pacchetti: Trasmessi = 2, Ricevuti = 2,
Persi = 0 (0% persi),
Tempo approssimativo percorsi andata/ritorno in millisecondi:
Minimo = 42ms, Massimo = 55ms, Medio = 48ms

the pc surf through wifi

very odd.

what do you see if you enter the below...

ping registry.npmjs.org

Also, open a powershell prompt on that PC & enter:

Invoke-WebRequest https://registry.npmjs.org`

example:

PS C:\newfldr> ping registry.npmjs.org

Esecuzione di Ping registry.npmjs.org [104.16.21.35] con 32 byte di dati:
Risposta da 104.16.21.35: byte=32 durata=31ms TTL=53
Risposta da 104.16.21.35: byte=32 durata=75ms TTL=53
Risposta da 104.16.21.35: byte=32 durata=33ms TTL=53
Risposta da 104.16.21.35: byte=32 durata=36ms TTL=53

Statistiche Ping per 104.16.21.35:
Pacchetti: Trasmessi = 4, Ricevuti = 4,
Persi = 0 (0% persi),
Tempo approssimativo percorsi andata/ritorno in millisecondi:
Minimo = 31ms, Massimo = 75ms, Medio = 43ms
PS C:\newfldr> ^C
PS C:\newfldr> Invoke-WebRequest https://registry.npmjs.org

StatusCode : 200
StatusDescription : OK
Content : {"db_name":"registry","engine":"couch_bt_engine","doc_count":3560876,"doc_del_count":332,"update_seq":35162241,"purge_seq":0,"compact_running":false,"sizes":{"active":82281027932,"external":2301956991...
RawContent : HTTP/1.1 200 OK
Transfer-Encoding: chunked
Connection: keep-alive
CF-Ray: 7a737ef87e900281-CDG
Strict-Transport-Security: max-age=2592000000; includeSubDomains; preload;
Vary: Accept-Encoding
CF...
Forms : {}
Headers : {[Transfer-Encoding, chunked], [Connection, keep-alive], [CF-Ray, 7a737ef87e900281-CDG], [Strict-Transport-Security, max-age=2592000000; includeSubDomains; preload;]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 470

so, as far as I can see, everything appears to be in order.

Perhaps you have a REALLY slow internet connection causing the ERR_SOCKET_TIMEOUT

In powershell, paste the below

Function Measure-NetworkSpeed{
    # The test file has to be a 10MB file for the math to work. If you want to change sizes, modify the math to match
    $TestFile  = 'https://ftp.sunet.se/mirror/parrotsec.org/parrot/misc/10MB.bin'
    $TempFile  = Join-Path -Path $env:TEMP -ChildPath 'testfile.tmp'
    $WebClient = New-Object Net.WebClient
    $TimeTaken = Measure-Command { $WebClient.DownloadFile($TestFile,$TempFile) } | Select-Object -ExpandProperty TotalSeconds
    $SpeedMbps = (10 / $TimeTaken) * 8
    $Message = "{0:N2} Mbit/sec" -f ($SpeedMbps)
    $Message
}

Measure-NetworkSpeed

You should see ...
image

Or visit https://fast.com/ on that computer

the speed is very slow, 0.2Mbit/sec..
Maybe the problem is a speed..
Is there a solution to install off line or in other way?

ouch!

You can install on another computer of the same OS type can copy things over. Though you will find it easier generally to do this with a local node-red install rather than a global one. However, either is possible, you just need to track down the right file folders.