npm / npm/cli

[BUG] MacOS issue trying to create link?

Open
#5,769 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
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

In an existing project, moving to Node v16 from v14, using stock npm with the latest v16 build, NPM install throws a "FETCH_ERROR" claiming "invalid json response body", and the reason "ENOTSUP: operation not supported on socket, link" followed by two paths. Running "ln -s" with the two paths works, providing the first path exists.

Have then proceeded to try removing just the node_modules, and subsequently the package-lock.json file too, attempting to accomodate an upgrade, but still get the same issue.

npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/react reason: Invalid response body while trying to fetch https://registry.npmjs.org/react: ENOTSUP: operation not supported on socket, link '/Users/liam/.npm/_cacache/tmp/edfbbbb9' -> '/Users/liam/.npm/_cacache/content-v2/sha512/6a/12/9c307bd3cba7f78c6897320687541d8d881be03d4c1dfb662c41d7cf86a938badd3d44a89e803b22411a0f60866690dafffa02086d386494bfccbb2110a4'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/liam/.npm/_logs/2022-10-28T13_22_03_819Z-debug-0.log
Expected Behavior

I expect this to install without issues, just as npm v6 does.

Steps To Reproduce
  1. On existing project that worked (and still works) on npm v6 (with Node 14)
  2. Use npm v8 - `nvm use 16'
  3. npm install - Error thrown
  4. rm -rf node_modules
  5. npm install - Error thrown
  6. rm package-lock.json
  7. npm install - Error thrown
Environment
  • npm: v8.19.2
  • Node.js: v16.18.0
  • OS Name: MacOS 12.5.1
  • System Model Name: Mac Mini (2018)
  • npm config:
; node bin location = /Volumes/Extreme Pro/.nvm/versions/node/v16.18.0/bin/node
; node version = v16.18.0
; npm local prefix = /Volumes/Extreme Pro/apps/fenestra/react-native
; npm version = 8.19.2
; cwd = /Volumes/Extreme Pro/apps/fenestra/react-native
; HOME = /Users/liam

Node has been installed via nvm, within a shared directory sitting on a secondary drive due to insufficient space on the main drive to perform updates if things run from there, especially a copy per user.

/Users/liam/.nvm links to /Volumes/Extreme Pro/.nvm and the .npm folder is the same.

The drive is ExFat and hasn't caused any problems on Node v14/NPM v6 - this is important as it has resulted in no permission issues when shared between the developers that need the same environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing npm install with npm 8.19.2, Node.js 16.18.0, macOS 12.5.1, nvm on the shared exFAT volume, and the existing project setup described here. Inspect the FETCH_ERROR, cache paths, symlink setup, and debug log; the issue is resolved when installation completes without the ENOTSUP socket-link error in this environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, macos, nodejs
Domain
cli, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.