Skip to content

npm install fails on old laptops #4327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
owlbrudder opened this issue Jan 15, 2024 · 16 comments
Closed

npm install fails on old laptops #4327

owlbrudder opened this issue Jan 15, 2024 · 16 comments
Labels

Comments

@owlbrudder
Copy link

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.

@preveen-stack
Copy link
Contributor

preveen-stack commented Jan 17, 2024

Can you share the error log you are getting

@owlbrudder
Copy link
Author

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
Copy link
Author

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.

@preveen-stack
Copy link
Contributor

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

@owlbrudder
Copy link
Author

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

@preveen-stack
Copy link
Contributor

preveen-stack commented Jan 18, 2024

Please provide full error log as a gist.

Also can perhaps connect to another network temporarily and check

@owlbrudder
Copy link
Author

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.

@preveen-stack
Copy link
Contributor

preveen-stack commented Jan 19, 2024

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 npm/npm#18903 (comment)

@owlbrudder
Copy link
Author

owlbrudder commented Jan 19, 2024

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.

@preveen-stack
Copy link
Contributor

Can you check syslog to see if eveything is okay

@owlbrudder
Copy link
Author

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 request/request#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.
`

@preveen-stack
Copy link
Contributor

@owlbrudder
Copy link
Author

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.

@avivkeller
Copy link
Member

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

Copy link

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 github-actions bot added the stale label Dec 29, 2024
Copy link

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 github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants