StreakYC / react-draggable-list

React component for a list of draggable collapsible items
MIT License
319 stars 48 forks source link

Unable to install dependencies with Node 20.9 or 18.18 #61

Closed wegry closed 6 months ago

wegry commented 6 months ago

When trying to install dependencies for this library on Node 20 or 18, the current LTS, yarn fails.

➜  react-draggable-list git:(main) yarn
yarn install v1.22.17
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
warning " > react-motion@0.5.2" has incorrect peer dependency "react@^0.14.9 || ^15.3.0 || ^16.0.0".
[4/4] πŸ”¨  Building fresh packages...
[1/4] β‘€ fsevents
[2/4] β‘€ core-js
[3/4] β‘€ deasync
error [HOME]/react-draggable-list/node_modules/deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: [HOME]/react-draggable-list/node_modules/deasync
Output:
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ]
}

warning Error running install script for optional dependency: "[HOME]/react-draggable-list/node_modules/@parcel/watcher/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: [HOME]/react-draggable-list/node_modules/@parcel/watcher/node_modules/fsevents
Output:
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ]
}

Node.js v18.18.2"

Looks like it might be the old parcel-bundler that could be causing the issue.

➜  react-draggable-list git:(main) βœ— yarn why -R deasync
└─ react-draggable-list@workspace:.
   └─ parcel-bundler@npm:1.12.5 (via npm:^1.10.3)
      └─ deasync@npm:0.1.28 (via npm:^0.1.14)

Workaround

Using the unsupported Node 16 seems to still work:

➜  react-draggable-list git:(main) nvm use 16
Now using node v16.20.2 (npm v8.19.4)
➜  react-draggable-list git:(main) yarn
yarn install v1.22.17
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
warning " > react-motion@0.5.2" has incorrect peer dependency "react@^0.14.9 || ^15.3.0 || ^16.0.0".
[4/4] πŸ”¨  Building fresh packages...
$ rimraf dist && babel -s true -d dist/src/ src/ -x .ts,.tsx --ignore '**/*.test.tsx' && tsc
Successfully compiled 4 files with Babel (394ms).
✨  Done in 18.82s.