Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Packages failing to install on Ubuntu 20.04 #20668

Closed
1 task done
MarcusAlmert opened this issue Apr 25, 2020 · 7 comments
Closed
1 task done

Packages failing to install on Ubuntu 20.04 #20668

MarcusAlmert opened this issue Apr 25, 2020 · 7 comments

Comments

@MarcusAlmert
Copy link

MarcusAlmert commented Apr 25, 2020

Prerequisites

Description

Atom packages can't be installed on Ubuntu 20.04

Steps to Reproduce

  1. Installing apm package trough atom directly or via manual install

Expected behavior:

Package installs.

Actual behavior:

For example when installing terminus via apm install terminus
Log:

marcus@~$ apm install terminus
Installing terminus to /home/marcus/.atom/packages ✗
node-pty-prebuilt-multiarch@0.9.0 install /tmp/apm-install-dir-120325-178860-l8s1ro.s8njo/node_modules/terminus/node_modules/node-pty-prebuilt-multiarch
prebuild-install || node scripts/install.js
Aborted (core dumped)
Aborted (core dumped)
gyp: Call to 'node -e "require('nan')"' returned exit status 134 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 5.4.0-26-generic
gyp ERR! command "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-120325-178860-l8s1ro.s8njo/node_modules/terminus/node_modules/node-pty-prebuilt-multiarch
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
Aborted (core dumped)
Aborted (core dumped)
npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-120325-178860-l8s1ro.s8njo/package.json'
npm WARN apm-install-dir-120325-178860-l8s1ro.s8njo No description
npm WARN apm-install-dir-120325-178860-l8s1ro.s8njo No repository field.
npm WARN apm-install-dir-120325-178860-l8s1ro.s8njo No README data
npm WARN apm-install-dir-120325-178860-l8s1ro.s8njo No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! node-pty-prebuilt-multiarch@0.9.0 install: `prebuild-install || node scripts/install.js`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the node-pty-prebuilt-multiarch@0.9.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/marcus/.atom/.apm/_logs/2020-04-25T10_34_51_603Z-debug.log

Complete Log

Reproduces how often:

100% of the time.

Versions

Tested on:
Atom : 1.45.0
Electron: 4.2.7
Chrome : 69.0.3497.128
Node : 10.11.0

and:
Atom : 1.48.0-nightly1
Electron: 5.0.13
Chrome : 73.0.3683.121
Node : 12.0.0

Additional Information

I think it could somehow be related to node-gyp and python.
Maybe #20406 / #20356 ?

@MarcusAlmert MarcusAlmert changed the title Packeges failing to install on Ubuntu 20.04 Packages failing to install on Ubuntu 20.04 Apr 25, 2020
@DeeDeeG
Copy link
Contributor

DeeDeeG commented Apr 27, 2020

Hi,

(I am not a maintainer of Atom, so these are just my comments as an Atom user.)

I can install terminus and I am on Ubuntu 20.04.


Can you run apm --version? If you see in the output of that command "python 2.7.18rc1" or some other Python 2.x, your issue here is likely not related to #20406 or #20356


I see this in the error message you posted:

gyp: Call to 'node -e "require('nan')"' returned exit status 134 while in binding.gyp. while trying to load binding.gyp

Sounds like some code tried to bring in this package but failed: https://www.npmjs.com/package/nan

This seems like a fairly core thing to NodeJS and shouldn't be having issues. And if there is a bug it might not be within the Atom/apm code.

Does terminus consistently fail to install on your machine? If so, maybe you can try Uninstalling/reinstalling Atom? Then if that doesn't work, deleting ~/.apm (rm -rf ~/.atom this gets rid of any custom configurations you have, so perhaps back it up first: mv ~/.atom ~/.atom_backup)?

If that doesn't work, perhaps you can try installing Atom in a LiveCD environment (after booting the Ubuntu 20.04 install iso but before/without installing) and see if apm install terminus still fails there?

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Apr 27, 2020

According to NodeJS docs, https://github.com/nodejs/node/blob/master/doc/api/process.md#exit-codes, Error code 134 is SIGABRT, which is usually triggered when a program catches a weird state in its own operation. https://stackoverflow.com/questions/3413166/when-does-a-process-get-sigabrt-signal-6

A comment here said it was down to running out of system RAM/memory: laverdet/node-fibers#358 (comment)

Perhaps you are running out of RAM/memory when running apm install terminus? You can try closing other programs that use a lot of RAM. You can check what mg be using lots of memory with a task manager such as htop or gnome-system-monitor.

@MarcusAlmert
Copy link
Author

@DeeDeeG Thanks for your reply.

Yes, it fails every time I try to install any of the terminal packages.

apm --version returns:

apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.45.0
python 2.7.18rc1
git 2.25.1

I tried installing nan with npm install --save nan as recommended on https://www.npmjs.com/package/nan

I also cleared the cache of npm and did a re-install.

I removed atom and atom nightly, removed their ~/.atom folder and installed them again.

My memory usage peaks at 2.6Gbyte out of 16Gbyte while installing.

I still get the same error.

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Apr 27, 2020

If you tried this from a LiveCD/LiveUSB environment, it would be like "safe mode" for Ubuntu. That would rule out anything unusual with your software and boil it down to "does this happen on your hardware with a perfectly clean version of Ubuntu and Atom?"

If that worked, it would be narrowed down to something more specific you may have configured/installed on your system since installing Ubuntu. If it fails in Ubuntu LiveCD environment, then it has nothing to do with anything you might have done on your system since installing Ubuntu.

I personally don't know anything more than that for narrowing this bug down.

It seems likely to be a bug in node, npm or node-gyp... perhaps a bug that has been fixed already. apm currently bundles an old node, npm and node-gyp.

But this is all a guess, sorry.

@MarcusAlmert
Copy link
Author

I removed every file in relation to npm, node or atom now.
Installation will fail nonetheless.
I tried with atom from apt and the official .deb installation file.

Cant get it to work in a fresh Ubuntu install either.

@rtubio
Copy link

rtubio commented May 7, 2020

I have the exact same issue in Debian 10 using Atom installed from the official repository; the issue started occurring after I tried to install "terminal-tab" as a package.

Configuration as follows:

apm --version
apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.46.0
python 2.7.16
git 2.20.1

uname -a
Linux mako 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1+deb10u1 (2020-04-27) x86_64 GNU/Linux

Could this issue be related with the ENOENT for package.js not found, as seen in the log?

@rtubio
Copy link

rtubio commented May 7, 2020

JunoLab/atom-ink#212

This solved the problem in my case. It turns out that you need to remove all system installed npm interpreters, so that they do not conflict with apm. In my case, it was enough with:

sudo apt purge npm

You might check with "which npm" and remove all npm references from the PATH before executing "apm install XXX".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants