Skip to content

install fails in Ubuntu 19.04 #565

@MasterJames

Description

@MasterJames

With the latest Ubuntu 19.04 (2019-05-01 when you use npm to install 'n'
npm install -g n
it will not overwrite the appropriate files and it doesn't work.

First off npm not found so it says apt install npm to install
similar is the case for node but

apt list nodejs
Listing... Done
nodejs/disco 10.15.2~dfsg-1 amd64

there is no node or nodejs accessible tough my guess is it's what's in a list of available apt update gets? I used to think it was listing what's installed?

wanting to use npm to install node you can try to install npm first.
It has an absurdly lengthy dependency listing that one must grudgingly allows.

One of the dependencies is node so then node and nodejs both show v10.15.2
npm -v is 5.8.0

I proceed to install 'n' rather quickly with npm install -g n

root@server:/tmp# npm install -g n
npm WARN npm npm does not support Node.js v10.15.2
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 Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@3.0.2
added 1 package from 4 contributors in 1.044s
root@server:/tmp#

The warning says update node but I want 11.8.0 anyway so

root@mdserver:/tmp# n 11.8.0
     install : node-v11.8.0
       mkdir : /usr/local/n/versions/node/11.8.0
       fetch : https://nodejs.org/dist/v11.8.0/node-v11.8.0-linux-x64.tar.gz
   installed : v11.8.0

and it is there in /usr/local/n/versions/node/11.8.0
Unfortunately typing node --version comes up
v10.15.2
as does nodejs not that they are suppose to be different, just redunant I think, so the confusion begins there with the duplicates of node and nodejs

Second bad thing is there is still 'which node' = /usr/local/bin/node
and there is a /usr/bin/node as well as nodejs
there is no link between them but they are dependent
as this command output sequence demonstrates

root@server:/tmp# mv /usr/bin/node /usr/bin/node2
root@server:/tmp# node
bash: /usr/bin/node: No such file or directory
root@server:/tmp# which node
/usr/local/bin/node

npm doesn't actually work at that point because it suffers the same glitches I guess.

root@server:/tmp# which npm
/usr/local/bin/npm
root@server:/tmp# npm
 1: 0x948a70 node::Abort() [node]
 2: 0x997982 node::options_parser::GetOptions(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 3: 0xba5e0a  [node]
 4: 0xba69b9 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 5: 0x24196574fc5d
Aborted (core dumped)

Yup all messed up.

root@server:/tmp# L /usr/bin/npm
0 lrwxrwxrwx 1 root root 27 Feb 13 22:01 /usr/bin/npm -> ../share/npm/bin/npm-cli.js
root@server:/tmp# which npm
/usr/local/bin/npm
root@server:/tmp# L /usr/local/bin/npm
0 lrwxrwxrwx 1 root root 38 May  3 03:09 /usr/local/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
root@server:/tmp#

I think there's enough in this initiall report to try for yourself what a mess it is and that it doesn't work to overwrite the dependencies usr/bin usr/local/bin etc.

Maybe I've done something wrong but it seems correct to install npm and then 'n' and try the version I need 11.8.0 but have nothing work and I've pointed to something odd going on.

Maybe the Ubuntu people have messed up the permissions or something maybe there is an install debug flag that would reveal the glitch preventing any of it from working.

Yes I restored node2 to node but npm -v still core dumps.

npm is too cool now to allow bug reports without going their special site https://npm.community/c/bugs (I'm not a member).
Maybe you want to connect with them about this, but my guess it's something inherently wrong with Ubuntu 19.04 changes somehow, so you need to talk to npm who need to talk with Ubuntu so the dependency chain is making debugging a painful three pillar exercise as well, or maybe this is not your problem and you simply want to pass the buck and close this. I guess then I could point npm to this page and so on down the line until somebody who knows what is happening and responsible can repair the problem.

For now I build a simple script that deleted all default Ubuntu 19.04 node and npm installations and files and downloads the installer directly from the source like your 'n' program does and replaces the files and links in /usr/bin and /usr/local/bin
Maybe it's been 3 decades and I've forgotten but why they need both node and nodejs and copies that are not links but depended from /usr/local/bin (PATH) to /usr/bin seems too complicated and the source of the problems.
Anyone with insight why that is or needs to be please speak-up but I think that part needs to be rethought and abolished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions