[BUG] fallback behaviour when hard links aren't supported
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the Haiku build commands and make test-only, then inspect the log to locate the hard-link operation in npm's test path. Trace how the npm CLI handles link creation and verify the fallback behavior on a filesystem without hard-link support. Done means the test command succeeds using symlinks where hard links are unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100