Skip to content
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

[BUG] fallback behaviour when hard links aren't supported #5951

Open
2 tasks done
jessicah opened this issue Dec 11, 2022 · 4 comments
Open
2 tasks done

[BUG] fallback behaviour when hard links aren't supported #5951

jessicah opened this issue Dec 11, 2022 · 4 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@jessicah
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Running make test-only for nodejs, npm fails with EPERM, apparently from trying to create a hard link, but the file system has no support for hard links.

Log file: https://gist.github.com/jessicah/32af57e465f6f4a340f79117863f756e

Expected Behavior

Fallback behaviour to use symlinks for filesystems without hard links. Not sure whether this should be here in npm, or if a workaround should be done in nodejs itself.

Steps To Reproduce

For building nodejs on Haiku:

pkgman install devel:libcares devel:libexecinfo devel:libnghttp2 devel:libssl devel:libuv devel:libbrotli cmd:ninja
./configure --with-intl=none --dest-os=haiku --without-npm --verbose --prefix=~/config/non-packaged --shared-cares --shared-libuv --shared-nghttp2 --shared-openssl --shared-zlib --shared-brotli
make
make test-only

Example of ln failing:

ln foo bar
# ln: failed to create hard link 'bar' => 'foo': Operation not supported (EPERM)

Environment

  • npm: 8.19.2
  • Node.js: 16.18.1 + patches
  • OS Name: Haiku x86_64 (nightly)
  • System Model Name: Virtual Box
  • npm config: N/A
@jessicah jessicah added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Dec 11, 2022
@jessicah jessicah changed the title [BUG] <title> [BUG] fallback behaviour when hard links aren't supported Dec 11, 2022
@ljharb
Copy link
Contributor

ljharb commented Dec 11, 2022

What does make test-only do? This doesn't seem related to npm. Did you perhaps want to file an issue on node?

(also, using a patched node likely means node can't really support you, but i'll let them respond to an issue there)

@jessicah
Copy link
Author

I don't know, but the error looks like it's coming from npm trying to create a hardlink in the .npm/cacache thing.

I filed with node, they said it's npm.

@ljharb
Copy link
Contributor

ljharb commented Dec 12, 2022

Can you link to that? because in your OP you didn't even compile node with npm.

@beasteers
Copy link

beasteers commented Jan 3, 2023

I'm having a similar issue with AKS when trying to run npm install with an azure files volume mount. I'm getting an error about hard links not being supported when it's trying to do a hardlink in .npm/cacache

(@ljharb this looks like the referenced issue btw) nodejs/node#45818

I'm looking for a way to avoid using hardlinks during an install because this is blocking me from installing anything.

details about the npm install issue

Here's the log output on my end (nodered is running npm install, but the same thing happens when you run npm i pkg manually in the container):

2023-01-03T21:46:21.478Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-postgresql@0.11.3
2023-01-03T21:46:22.189Z [err] npm
2023-01-03T21:46:22.189Z [err]  WARN
2023-01-03T21:46:22.189Z [err]  config production Use `--omit=dev` instead.
2023-01-03T21:46:22.644Z [err] npm
2023-01-03T21:46:22.644Z [err]  ERR! code ENOTSUP
2023-01-03T21:46:22.644Z [err] npm
2023-01-03T21:46:22.644Z [err]  ERR!
2023-01-03T21:46:22.644Z [err]  syscall link
2023-01-03T21:46:22.644Z [err] npm ERR!
2023-01-03T21:46:22.644Z [err]  
2023-01-03T21:46:22.645Z [err] path /data/.npm/_cacache/tmp/78da15c8
2023-01-03T21:46:22.645Z [err] npm ERR! dest /data/.npm/_cacache/content-v2/sha512/71/6f/d7852a119e0ba4879feb7f584dc48ed54bd579c78f809b3af2188d89a3fc5fd14a421e419c3fa720905d8b7b5f2f42c76816907b0a160a50c78c3d57825b
2023-01-03T21:46:22.645Z [err] npm ERR! errno ENOTSUP
2023-01-03T21:46:22.647Z [err] npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/node-red-contrib-postgresql: ENOTSUP: operation not supported on socket, link '/data/.npm/_cacache/tmp/78da15c8' -> '/data/.npm/_cacache/content-v2/sha512/71/6f/d7852a119e0ba4879feb7f584dc48ed54bd579c78f809b3af2188d89a3fc5fd14a421e419c3fa720905d8b7b5f2f42c76816907b0a160a50c78c3d57825b'
2023-01-03T21:46:22.648Z [err] 
2023-01-03T21:46:22.648Z [err] npm ERR!
2023-01-03T21:46:22.648Z [err]  A complete log of this run can be found in:
2023-01-03T21:46:22.648Z [err] npm ERR!     /data/.npm/_logs/2023-01-03T21_46_22_092Z-debug-0.log
2023-01-03T21:46:22.674Z rc=1

The crucial line being ENOTSUP: operation not supported on socket, link A -> B. The "complete log" doesn't give anymore info than this.

Confirmed a similar error when trying to hardlink the files myself: link /data/.npm/_cacache/tmp/... /data/.npm/_cacache/content-v2/...

link: can't create hardlink '...' to '...': Not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

3 participants