2023-11-14, 10:59 AM
Since a while (possibly, but not certain, since I updated the Signal K server from v1.4 to v2.1), I could not install nor update apps from the Signal K Appstore. As I really wanted to update KIP, I decided to update Signal K server with OpenPlotter Signal K installer (latest updated version) but this failed as well. Trying with terminal I got this:
**************
pi@Antares:~ $ sudo rm -rf /usr/lib/node_modules/signalk-server
pi@Antares:~ $ npm install -g signalk-server
/usr/lib/node_modules/npm/lib/cli.js:35
throw err
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/fs-minipass/lib/index.js:136:4)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:121:18)
at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/cacache/lib/content/read.js:4:13)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Node.js v18.17.1
pi@Antares:~ $
**********
npm and Node.js are under /usr/node_modules
I did not want to redo a clean install of OpenPlotter as I have many other softs and data on my 250GB SSD as well as poor Internet connectivity.
Trying to install npm anew gave:
**********
pi@Antares:~ $ sudo apt-get -f install npm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libnode72 : Conflicts: nodejs-legacy
nodejs : Conflicts: npmsudo apt-get autoclean
E: Unable to correct problems, you have held broken packages.
**********
It seems to be a problem between nodejs and npm because nodejs gets installed from deb.nodesource.com while npm comes from ubuntu.
I found a solution by removing nodejs and npm entirely (perplexity.ai)
$ sudo apt-get --purge remove nodejs node npm
$ sudo apt-get clean
$ sudo apt-get autoclean
$ sudo apt-get -f install
$ sudo apt-get autoremove
and reinstalling nodejs with aptitude (Installing nodejs will install npm)
$ sudo apt install aptitude
$ sudo aptitude install npm
Reinstalling Signal K server and the apps was then possible again.
**************
pi@Antares:~ $ sudo rm -rf /usr/lib/node_modules/signalk-server
pi@Antares:~ $ npm install -g signalk-server
/usr/lib/node_modules/npm/lib/cli.js:35
throw err
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/fs-minipass/lib/index.js:136:4)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:121:18)
at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/cacache/lib/content/read.js:4:13)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Node.js v18.17.1
pi@Antares:~ $
**********
npm and Node.js are under /usr/node_modules
I did not want to redo a clean install of OpenPlotter as I have many other softs and data on my 250GB SSD as well as poor Internet connectivity.
Trying to install npm anew gave:
**********
pi@Antares:~ $ sudo apt-get -f install npm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libnode72 : Conflicts: nodejs-legacy
nodejs : Conflicts: npmsudo apt-get autoclean
E: Unable to correct problems, you have held broken packages.
**********
It seems to be a problem between nodejs and npm because nodejs gets installed from deb.nodesource.com while npm comes from ubuntu.
I found a solution by removing nodejs and npm entirely (perplexity.ai)
$ sudo apt-get --purge remove nodejs node npm
$ sudo apt-get clean
$ sudo apt-get autoclean
$ sudo apt-get -f install
$ sudo apt-get autoremove
and reinstalling nodejs with aptitude (Installing nodejs will install npm)
$ sudo apt install aptitude
$ sudo aptitude install npm
Reinstalling Signal K server and the apps was then possible again.