mscdex / mmmagic

An async libmagic binding for node.js for detecting content types by data inspection
MIT License
619 stars 50 forks source link

Can't install package since Monterey 12.3 #163

Closed nick-xero closed 2 years ago

nick-xero commented 2 years ago

It seems like installing this package needs python2 and MacOS Monterey 12.3 removed python2. So I was running into python not found when runnning npm install mmmagic

11609 verbose stack Error: mmmagic@0.5.3 install: `node-gyp rebuild`
11609 verbose stack Exit status 1
11609 verbose stack     at EventEmitter.<anonymous> (/Users/***/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
11609 verbose stack     at EventEmitter.emit (events.js:400:28)
11609 verbose stack     at ChildProcess.<anonymous> (/Users/***/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
11609 verbose stack     at ChildProcess.emit (events.js:400:28)
11609 verbose stack     at maybeClose (internal/child_process.js:1058:16)
11609 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
11610 verbose pkgid mmmagic@0.5.3
mscdex commented 2 years ago

You'll have to include the actual errors that should be above these lines in the log output, otherwise there is no way to know what is causing the build to fail.

mscdex commented 2 years ago

If it is a python issue, that's not a mmmagic issue, but a node-gyp issue. A brief google search reveals that node-gyp 5.0.5 or 6.0.0 or newer have full Python 3 support. So either upgrade node (which will upgrade the bundled npm) or upgrade npm directly, which will pick up a more recent node-gyp if your bundled/installed version is too old.