Installation of npm install -g node-red-contrib-iot2000 failed on iot2040

Hello,

I tryed to install the libary above, but it's failed with following error messages.
Anyone have a Idea?

root@iot2000:~# npm install -g node-red-contrib-iot2000
npm WARN npm npm does not support Node.js v8.16.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! URL is not defined

npm ERR! A complete log of this run can be found in:
npm ERR! /home/root/.npm/_logs/2021-11-11T20_03_29_007Z-debug.log

Here is the logfile:

1 warn npm You should probably upgrade to a newer version of node as we
2 warn npm can't make any promises that npm will work with this version.
3 warn npm You can find the latest version at https://nodejs.org/
4 verbose cli [ '/usr/bin/node',
4 verbose cli   '/usr/bin/npm',
4 verbose cli   'install',
4 verbose cli   '-g',
4 verbose cli   'node-red-contrib-iot2000' ]
5 info using npm@7.15.0
6 info using node@v8.16.0
7 timing npm:load:whichnode Completed in 71ms
8 timing config:load:defaults Completed in 119ms
9 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 66ms
10 timing config:load:builtin Completed in 72ms
11 timing config:load:cli Completed in 204ms
12 timing config:load:env Completed in 14ms
13 timing config:load:project Completed in 32ms
14 timing config:load:file:/home/root/.npmrc Completed in 9ms
15 timing config:load:user Completed in 12ms
16 timing config:load:file:/usr/etc/npmrc Completed in 4ms
17 timing config:load:global Completed in 9ms
18 timing config:load:validate Completed in 12ms
19 timing config:load:credentials Completed in 93ms
20 timing config:load:setEnvs Completed in 66ms
21 timing config:load Completed in 641ms
22 timing npm:load:configload Completed in 652ms
23 timing npm:load:setTitle Completed in 6ms
24 timing npm:load:setupLog Completed in 110ms
25 timing npm:load:cleanupLog Completed in 163ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load:projectScope Completed in 10ms
28 timing npm:load Completed in 1217ms
29 timing config:load:flatten Completed in 160ms
30 timing arborist:ctor Completed in 65ms
31 timing idealTree:init Completed in 664ms
32 timing idealTree:userRequests Completed in 163ms
33 silly idealTree buildDeps
34 silly fetch manifest node-red-contrib-iot2000@*
35 silly placeDep ROOT node-red-contrib-iot2000@ Symbol(OK) for:  want: *
36 timing idealTree:#root Completed in 572ms
37 timing idealTree:node_modules/node-red-contrib-iot2000 Completed in 4ms
38 timing idealTree:buildDeps Completed in 683ms
39 timing idealTree:fixDepFlags Completed in 66ms
40 timing idealTree Completed in 1675ms
41 timing command:install Completed in 2467ms
42 verbose stack ReferenceError: URL is not defined
42 verbose stack     at regKeyFromURI (/usr/lib/node_modules/npm/node_modules/npm-registry-fetch/auth.js:7:18)
42 verbose stack     at getAuth (/usr/lib/node_modules/npm/node_modules/npm-registry-fetch/auth.js:49:18)
42 verbose stack     at regFetch (/usr/lib/node_modules/npm/node_modules/npm-registry-fetch/index.js:55:16)
42 verbose stack     at RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:86:15)
42 verbose stack     at RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:117:17)
42 verbose stack     at Object.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/index.js:16:45)
42 verbose stack     at Arborist.[fetchManifest] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1074:24)
42 verbose stack     at Arborist.[nodeFromSpec] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1092:29)
42 verbose stack     at Arborist.[nodeFromEdge] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:934:44)
42 verbose stack     at Arborist.[buildDepStep] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:880:36)
43 verbose cwd /home/root

Thx
Denis

I think the version of npm that you have installed is not compatible with the version of nodejs installed. You have a very old and long unsupported version of nodejs, but a recent version of npm.

Not only is Node.js out of date - but why are you installing nodes to global? That will only cause you trouble later on when the incorrect file permissions trip things up.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.