Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to detect compiler type in deno install --allow-scripts for npm:cpu-features #28776

Open
ActuallyHappening opened this issue Apr 7, 2025 · 1 comment
Labels
upstream Changes in upstream are required to solve these issues

Comments

@ActuallyHappening
Copy link

ActuallyHappening commented Apr 7, 2025

deno 2.2.6 (stable, release, x86_64-unknown-linux-gnu)
v8 13.5.212.10-rusty
typescript 5.7.3

Hey!
I'm trying to use deno to replace node/npm at work, coming across a bunch of annoying hurdles like needing to deno install --global -A npm:node-gyp.
Currently, when I run deno install --allow-scripts, I am getting this error:

error: script 'install' in '[email protected]' failed with exit code 1
stderr:
error: Uncaught (in promise) Error: Unable to detect compiler type
    at BuildEnvironment.getKind (file:///home/ah/Desktop/<redacted>/node_modules/.deno/[email protected]/node_modules/buildcheck/lib/index.js:115:9)
    at BuildEnvironment.tryCompile (file:///home/ah/Desktop/<redacted>/node_modules/.deno/[email protected]/node_modules/buildcheck/lib/index.js:537:15)
    at BuildEnvironment.checkHeader (file:///home/ah/Desktop/<redacted>/node_modules/.deno/[email protected]/node_modules/buildcheck/lib/index.js:423:25)
    at Object.<anonymous> (file:///home/ah/Desktop/<redacted>/node_modules/.deno/[email protected]/node_modules/cpu-features/buildcheck.js:16:4)
    at Object.<anonymous> (file:///home/ah/Desktop/<redacted>/node_modules/.deno/[email protected]/node_modules/cpu-features/buildcheck.js:34:4)
    at Module._compile (node:module:745:34)
    at loadMaybeCjs (node:module:770:10)
    at Object.Module._extensions..js (node:module:755:12)
    at Module.load (node:module:662:32)
    at Module._load (node:module:534:12)

error: script 'install' in '@parcel/[email protected]' failed with exit code 143
error: script 'postinstall' in '[email protected]' failed with exit code 143
error: script 'postinstall' in '[email protected]' failed with exit code 143
error: failed to run scripts for packages: [email protected], @parcel/[email protected], [email protected], [email protected]

Looking at the build requirements, npm:cpu-features clearly requires node: https://github.com/mscdex/cpu-features?tab=readme-ov-file#requirements
Can this be 'patched' on denos side? Or should I open an issue on the cpu-features side?
Thanks

@marvinhagemeister
Copy link
Contributor

Looks like a bug in cpu-features. I can reproduce the same error in Node. The command that is spawned:

ccache cc -E -P -x c -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Changes in upstream are required to solve these issues
Projects
None yet
Development

No branches or pull requests

2 participants