ish icon indicating copy to clipboard operation
ish copied to clipboard

NPM Install Hanging

Open iamrecursion opened this issue 3 years ago • 22 comments

A continuation of #849. While the command no longer crashes, it now seems to hang indefinitely on both of my devices. It looks like this is related to something to do with the alpine edge repo, rather than 3.12. Exported rootFS is at the link below, as unfortunately it's too big for GH file upload.

npm install --save-dev --exact prettier

rootfs

You can easily reproduce this from scratch by doing the following:

  1. Import a new rootfs.
  2. Edit /etc/apk/repositories to point to edge instead of v3.12.
  3. apk update && apk upgrade --available.
  4. apk add npm nodejs.
  5. Run the above command.

iamrecursion avatar Aug 25 '20 08:08 iamrecursion

I can reproduce now, thanks for the rootfs download.

tbodt avatar Aug 25 '20 18:08 tbodt

Excellent! It's a curious one!

iamrecursion avatar Aug 25 '20 19:08 iamrecursion

Any update on this?

I get similar message when I run npm for a node app and gatsby app etc

d-javed avatar Sep 09 '20 14:09 d-javed

Reupload since the link expired: https://drive.google.com/file/d/18dEdK4BkQ_IOeUaKm3qVP7Q5hz5xgY1R/view

tbodt avatar Sep 20 '20 18:09 tbodt

I'm starting to suspect this is because of lack of TSO on arm. If so, it's pretty nuts that it's taken this long to become a problem.

tbodt avatar Sep 23 '20 06:09 tbodt

Perhaps it's a stupid question, but I legitimately can't work out which definition of TSO you mean here: the memory ordering, or TCP segment offloading?

iamrecursion avatar Sep 23 '20 08:09 iamrecursion

Memory ordering; ARM has a weaker memory model than Intel does. We’re looking into whether tightening the memory model on ARM causes the issue to go away. (So far, an Intel machine running iSH does not seem to exhibit this issue, which is supports but does not confirm this suspicion. Unfortunately the test we’ll run on ARM requires specific hardware and is just a diagnostic, not a fix.)

saagarjha avatar Sep 23 '20 08:09 saagarjha

That definitely makes more sense than where my brain first went. Let me know if I can help at all.

iamrecursion avatar Sep 23 '20 08:09 iamrecursion

Does not appear to be an issue with memory ordering, I was able to get hangs regardless of whether TSO was enabled.

saagarjha avatar Nov 19 '20 04:11 saagarjha

Oh, interesting! Any idea what else it could be?

iamrecursion avatar Nov 19 '20 08:11 iamrecursion

No idea. Maybe a bug in our ARM emulator? @tbodt will probably do the dirty work of figuring this out, so I’d ask him once he figures it out.

saagarjha avatar Nov 19 '20 09:11 saagarjha

Fair! I'm very interested.

iamrecursion avatar Nov 19 '20 09:11 iamrecursion

I have iPhone 12 Pro Max and have exactly the same issue. It's just hanging when I run for example npm i -g npm and cannot exit the process I need to force close whole iSH

MariuszPL55 avatar May 28 '21 07:05 MariuszPL55

There are still runtime problems with node.js and npm on the latest version (as of 6/21/21) on iPad Pro with current iOS. Both will hang and ^C no longer works, requiring an app restart. npm is 100% unusable for anything except npm --version. Oddly, both worked briefly after a brand new install but now fail consistently. The regressions in comments above work to recreate the problem. This would be a great bug to have resolved since it would make it possible to do completely mobile node.js development. Right now, it's really not possible. I know there's nothing new in this comment. I'm just bumping this year-old issue in hopes that it gets some love soon.

cshotton avatar Jun 21 '21 11:06 cshotton

@cshotton have you found any solution?

mxvsh avatar Jul 08 '21 02:07 mxvsh

@cshotton have you found any solution?

I have not tried it lately. I'll give it a shot. Right now, it's completely random as to whether or not it will hang on any given node or npm invocation. Certainly the more complex the command (e.g. npm install of a large package.json), the more likely a hang has been. Short answer is no.

cshotton avatar Aug 03 '21 19:08 cshotton

It sounds like a weird workaround, but adding --verbose option to npm seems to make it work better. It still hangs sometimes though.

inseo-oh avatar Aug 04 '21 00:08 inseo-oh

Any update on this? I haven't been able to run npm install in "ish". It never finishes.

arshadansari27 avatar Oct 23 '22 20:10 arshadansari27

Somehow when I crash the filesystem by playing around and by random googling in reddit. I found an old iSH vanilla FS in this thread: https://www.reddit.com/r/ish/comments/nzkm91/default_filesystem/.

Out of my curiosity, using this particular FS to install nodejs and npm can give you a working ( but outdated ) Node and Npm!

the download link is https://ish.shiggl.es/Vanilla.tar.gz, this file is not by me and please use it at your own risk!

ckanthony avatar Oct 28 '22 21:10 ckanthony

I have a similar issue - a fresh installation has the same problems regardless of file-system After following the instructions from the docs, I find that changing the /etc/apk/repositories versions to 3.12 allows the installation of nodejs 12.22.1 and a compatible version of npm, and no installation works further than this Any other version of the repositories (3.14 in the default, 3.16, 3.17, etc) led to an incompatibility in npm and nodejs leading to "Illegal instruction" for anything and everything.

Even with the working versions of npm, there's the constant hang issue that never goes away. I've attempted with "npm install -g npm@latest", "npm install -g npm@latest --verbose" and "npm install -g npm@latest --verbose -dd", and it still gets stuck on the rollbackFailedOptional, which I'm not able to proceed forward with.

Could somebody provide some pointers on how I could go further? I'm trying to install code-server. My device is the iPad 9th gen.

abhishekmaha-tno avatar Apr 11 '23 16:04 abhishekmaha-tno

Same issue on an iPad Air 5th gen, with installing the castnow npm package

Cysioland avatar Apr 27 '23 06:04 Cysioland

Just wondering if theres been any progress with npm? im trying to install 2 small packages awsp and ssh2

kevinrook avatar Jan 09 '24 11:01 kevinrook