youtube-dl-exec Fails to Install on macOS M1 Silicon Due to Postinstall Script Error #227
Closed
Description
Description:
The youtube-dl-exec
package fails to install on macOS M1 Silicon using both npm
and pnpm
. The error occurs during the postinstall
script.
Environment:
- Device: MacBook with M1 Silicon (Apple Silicon)
- Operating System: macOS
- Node.js Version: v20.7.0
- npm Version: 10.2.4
- youtube-dl-exec Version: 3.0.9 and 3.0.10 and 3.0.12
Steps to Reproduce:
- Initialize a new Node.js project:
mkdir test-project cd test-project npm init -y # or pnpm init -y
- Install the package:
npm install youtube-dl-exec # or pnpm add youtube-dl-exec
Expected Behavior:
The package should install without any errors.
Actual Behavior:
The installation fails with the following error:
npm ERR! code 1
npm ERR! path /[project-path]/node_modules/youtube-dl-exec
npm ERR! command failed
npm ERR! command sh -c node scripts/postinstall.js
npm ERR! /[project-path]/node_modules/youtube-dl-exec/scripts/postinstall.js:17
npm ERR! const { browser_download_url: url } = assets.find(
npm ERR! ^
npm ERR!
npm ERR! TypeError: Cannot read properties of undefined (reading 'find')
npm ERR! at getLatest (/[project-path]/node_modules/youtube-dl-exec/scripts/postinstall.js:17:48)
npm ERR! at getBinary (/[project-path]/node_modules/youtube-dl-exec/scripts/postinstall.js:26:22)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! at async Promise.all (index 0)
npm ERR! at async installBinary (/[project-path]/node_modules/youtube-dl-exec/scripts/postinstall.js:33:20)
npm ERR!
npm ERR! Node.js v20.7.0
npm ERR! A complete log of this run can be found in: /[user-home]/.npm/_logs/2025-01-15T10_54_47_345Z-debug-0.log
Additional Notes:
- The issue occurs with both
npm
andpnpm
. - Tried using
--ignore-scripts
, but the issue persists. shamefully-hoist
and cache clearing didn’t resolve the problem.- The error seems related to the
assets
variable beingundefined
in thepostinstall.js
.
Metadata
Assignees
Labels
No labels