help icon indicating copy to clipboard operation
help copied to clipboard

npm install fails on old laptops

Open owlbrudder opened this issue 1 year ago • 14 comments

Details

I have three machines, all running Fedora 38. The desktop is the main development machine, but I have two rather ancient laptops I use as test beds.

Currently I am working with the team on GitHub project opensourcepos. The desktop machine behaves perfectly, but both the old laptops running dual core Celeron CPUs and 4Gb RAM always get ECONNRESET errors when I run npm install.

All three machines are connected to the same modem and there is no proxy involved.

Is there a hardware lower limit to the capabilities of npm?

Node.js version

node.js v18.19.0 npm v10.2.3

Example code

No response

Operating system

Linux david 6.6.9-100.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 1 20:31:07 UTC 2024 x86_64 GNU/Linux

Scope

When running npm install for the opensourcepos project

Module and version

Not applicable.

owlbrudder avatar Jan 15 '24 00:01 owlbrudder

Can you share the error log you are getting

preveen-stack avatar Jan 17 '24 04:01 preveen-stack

Thank you for replying. Setting the log to verbose, I see many lines beginning with 'timing', then a TLSWrap.onStreamRead error, then it finishes with many 'unfinished npm timer' lines. The point of failure changes each time I run the command, but the error is the same. The relevant part of a typical log is this (I have added the bold):

939 timing reifyNode:node_modules/estraverse Completed in 14168ms 940 timing reifyNode:node_modules/is-bigint Completed in 14227ms 941 timing reifyNode:node_modules/mkdirp Completed in 14319ms 942 timing reifyNode:node_modules/file-uri-to-path Completed in 14235ms 943 timing reifyNode:node_modules/lru-cache Completed in 14308ms 944 verbose stack Error: read ECONNRESET 944 verbose stack at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) 945 verbose cwd /home/doug/public_html/ci4-branch/opensourcepos 946 verbose Linux 6.6.11-100.fc38.x86_64 947 verbose node v18.19.0 948 verbose npm v10.2.3 949 error code ECONNRESET 950 error syscall read 951 error errno -104 952 error network read ECONNRESET 953 error network This is a problem related to network connectivity. 953 error network In most cases you are behind a proxy or have bad network settings. 953 error network 953 error network If you are behind a proxy, please make sure that the 953 error network 'proxy' config is set properly. See: 'npm help config' 954 verbose exit -104 955 timing npm Completed in 24198ms 956 verbose unfinished npm timer command:ci 1705466510019 957 verbose unfinished npm timer reify 1705466518548 958 verbose unfinished npm timer reify:audit 1705466518867 959 verbose unfinished npm timer auditReport:getReport 1705466518868 960 verbose unfinished npm timer reify:unpack 1705466518925

owlbrudder avatar Jan 17 '24 04:01 owlbrudder

Following a suggestion turned up by Google, I tried

openssl s_client -msg -debug -state -connect registry.npmjs.org:443

This worked perfectly well with zero reported problems.

owlbrudder avatar Jan 17 '24 23:01 owlbrudder

Thanks for sharing the fix. Can you post the link to the fix

preveen-stack avatar Jan 18 '24 06:01 preveen-stack

My apologies for confusing you. It has not fixed my problem. I was just saying this test of the low level comms worked correctly. The laptop still gets ECONNRESET when running npm ci.

For completeness, the link I saw was: https://stackoverflow.com/questions/21767003/ssl-handshake-fails-after-clienthello

owlbrudder avatar Jan 18 '24 06:01 owlbrudder

Please provide full error log as a gist.

Also can perhaps connect to another network temporarily and check

preveen-stack avatar Jan 18 '24 10:01 preveen-stack

I have pasted the full verbose log into gist https://gist.github.com/owlbrudder/242250158aff52c34ac524326d1f900c

I have tried using my cellphone as a hotspot to get away from the modem normally used, but the result is the same.

The failure occurs at different places on each run. The desktop computer using the identical setup runs without error.

owlbrudder avatar Jan 18 '24 23:01 owlbrudder

Thanks for sharing the detailed log.

Could you perhaps try https://docs.npmjs.com/cli/v10/using-npm/config#maxsockets

Also, see if this work around is of any help https://github.com/npm/npm/issues/18903#issuecomment-382368672

preveen-stack avatar Jan 19 '24 09:01 preveen-stack

I will try adjusting that - it sounds promising. I tried a number of different maxsockets settings with no improvement .. until I set it to 1 and the old machine slowly ground its way a lot further through the job, but still died. I will rerun several times to see if it can progressively get through.

EDIT: SUCCESS!! Setting maxsockets to 1 on both the old laptops has seen them run npm ci to completion. Thank you very much for the pointer in that direction.

I did try http at one point, but the problem persisted.

owlbrudder avatar Jan 19 '24 09:01 owlbrudder

Can you check syslog to see if eveything is okay

preveen-stack avatar Jan 19 '24 10:01 preveen-stack

I could not find anything called syslog, but this is what was sent to the terminal: `[doug@david opensourcepos]$ npm ci npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated [email protected]: Deprecated due to CVE-2021-21366 resolved in 0.5.0 npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 1040 packages, and audited 1041 packages in 24m

135 packages are looking for funding run npm fund for details

17 vulnerabilities (4 moderate, 12 high, 1 critical)

To address issues that do not require attention, run: npm audit fix

To address all issues possible (including breaking changes), run: npm audit fix --force

Some issues need review, and may require choosing a different dependency.

Run npm audit for details. `

owlbrudder avatar Jan 19 '24 11:01 owlbrudder

https://www.linuxfoundation.org/blog/blog/classic-sysadmin-viewing-linux-logs-from-the-command-line HTH

preveen-stack avatar Jan 19 '24 11:01 preveen-stack

One mystery solved: Fedora does not install rsyslog by default, which is why I have never seen a file called syslog. I have just installed it and am now trying to work out what configuration I need in order to see the socket misbehaviour.

owlbrudder avatar Jan 20 '24 02:01 owlbrudder

Is this issue still occuring? If not, feel free to self-close.

avivkeller avatar Jul 01 '24 23:07 avivkeller

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Dec 29 '24 01:12 github-actions[bot]

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Jan 29 '25 01:01 github-actions[bot]