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

Mac M1 - instalation error with pnpm - ERR 404 even doing brew instalation #2431

Closed
1 task done
Donivanes opened this issue Sep 19, 2024 · 9 comments
Closed
1 task done

Comments

@Donivanes
Copy link

Donivanes commented Sep 19, 2024

Issue or Feature

After doing pnpm i canvas i have this issue

Progress: resolved 2012, reused 1945, downloaded 0, added 0, done
node_modules/.pnpm/[email protected]/node_modules/canvas: Running install script, failed in 1.6s
.../[email protected]/node_modules/canvas install$ node-pre-gyp install --fallback-to-build --update-binary
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using [email protected]
│ node-pre-gyp info using [email protected] | darwin | arm64
│ node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
│ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v1…
│ node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with …
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-…
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | darwin | arm64
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | darwin | arm64
│ gyp info find Python using Python version 3.12.6 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"
│ gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
│ gyp info spawn args [
│ gyp info spawn args '/Users/ivan/Library/pnpm/.tools/pnpm/9.10.0/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_…
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'make',
│ gyp info spawn args '-I',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/ivan/Library/pnpm/.tools/pnpm/9.10.0/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node_modules/node-gyp/addon.gy…
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/ivan/Library/Caches/node-gyp/20.7.0/include/node/common.gypi',
│ gyp info spawn args '-Dlibrary=shared_library',
│ gyp info spawn args '-Dvisibility=default',
│ gyp info spawn args '-Dnode_engine=v8',
│ gyp info spawn args '--depth=.',
│ gyp info spawn args '--no-parallel',
│ gyp info spawn args '--generator-output',
│ gyp info spawn args 'build',
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | darwin | arm64
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
│   SOLINK_MODULE(target) Release/canvas-postbuild.node
│   CXX(target) Release/obj.target/canvas/src/backend/Backend.o
│ In file included from ../src/backend/Backend.cc:1:
│ ../src/backend/Backend.h:5:10: fatal error: 'exception' file not found
│     5 | #include <exception>
│       |          ^~~~~~~~~~~
│ 1 error generated.
│ make: *** [Release/obj.target/canvas/src/backend/Backend.o] Error 1
│ gyp ERR! build error
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack at ChildProcess.<anonymous> (/Users/ivan/Library/pnpm/.tools/pnpm/9.10.0/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node_mo…
│ gyp ERR! System Darwin 24.0.0
│ gyp ERR! command "/Users/ivan/.volta/tools/image/node/20.7.0/bin/node" "/Users/ivan/Library/pnpm/.tools/pnpm/9.10.0/node_modules/.pnpm/[email protected]/no…
│ gyp ERR! node -v v20.7.0
│ gyp ERR! node-gyp -v v10.1.0
│ gyp ERR! not ok
│ node-pre-gyp ERR! build error
│ node-pre-gyp ERR! stack Error: Failed to execute '/Users/ivan/.volta/tools/image/node/20.7.0/bin/node /Users/ivan/Library/pnpm/.tools/pnpm/9.10.0/nod…
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/xxxxxx/node_modules/.pnpm/@mapbox+node-pre-gyp…
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
│ node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
│ node-pre-gyp ERR! System Darwin 24.0.0
│ node-pre-gyp ERR! command "/Users/ivan/.volta/tools/image/node/20.7.0/bin/node" "/Users/xxxxx/node_modules/.p…
│ node-pre-gyp ERR! cwd /Users/ixxxxx/node_modules/.pnpm/[email protected]/node_modules/canvas
│ node-pre-gyp ERR! node -v v20.7.0
│ node-pre-gyp ERR! node-pre-gyp -v v1.0.11
│ node-pre-gyp ERR! not ok
│ Failed to execute '/Users/ivan/.volta/tools/image/node/20.7.0/bin/node /Users/ivan/Library/pnpm/.tools/pnpm/9.10.0/node_modules/.pnpm/[email protected]/nod…
└─ Failed in 1.6s at /Users/xxxx/.pnpm/[email protected]/node_modules/canvas
 ELIFECYCLE  Command failed with exit code 1.

Steps to Reproduce

Just doing pnpm i canvas

I have also done the brew instalation because I'm using Mac M1

brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman python-setuptools

This doesn't fix it

Your Environment

  • Version of node-canvas 2.11.2
  • Environment node: 20.7.0 Mac M1 verion 15
@nicorch
Copy link

nicorch commented Sep 19, 2024

Exactly the same with node v20.17

@jialu98
Copy link

jialu98 commented Sep 20, 2024

Same with node v20.17 and Mac M2 macOS 15.0

@harrisonhowardax
Copy link

Happening on v18.19.0 Mac M1 macos 15.0

@harrisonhowardax
Copy link

harrisonhowardax commented Sep 20, 2024

Okay guys I found out what was breaking mine. For me, it was Xcode command line tools.
Do xcode-select --print-path, I deleted whatever the path was.
When you run xcode-select --print-path it should show a different path.
Run gcc after deleting the broken one and confirm it's still working.

Once I did that I restarted my computer and ran the install again, worked like a charm. Let me know if this fixes anyone else's issue.

EDIT:
If the path that is reported is /Library/Developer/CommandLineTools then it's wrong. The expected path is /Applications/Xcode.app/Contents/Developer.
The MacOS 15 update is likely the reason this occurs.

@nicorch
Copy link

nicorch commented Sep 20, 2024

Okay guys I found out what was breaking mine. For me, it was Xcode command line tools. Do xcode-select --print-path, I deleted whatever the path was. When you run xcode-select --print-path it should show a different path. Run gcc after deleting the broken one and confirm it's still working.

Once I did that I restarted my computer and ran the install again, worked like a charm. Let me know if this fixes anyone else's issue.

EDIT: If the path that is reported is /Library/Developer/CommandLineTools then it's wrong. The expected path is /Applications/Xcode.app/Contents/Developer. The MacOS 15 update is likely the reason this occurs.

Worked for me, Thanks

@Donivanes
Copy link
Author

Donivanes commented Sep 20, 2024

/Xcode.app

Okay guys I found out what was breaking mine. For me, it was Xcode command line tools. Do xcode-select --print-path, I deleted whatever the path was. When you run xcode-select --print-path it should show a different path. Run gcc after deleting the broken one and confirm it's still working.

Once I did that I restarted my computer and ran the install again, worked like a charm. Let me know if this fixes anyone else's issue.

EDIT: If the path that is reported is /Library/Developer/CommandLineTools then it's wrong. The expected path is /Applications/Xcode.app/Contents/Developer. The MacOS 15 update is likely the reason this occurs.

It worked for me also. Thank you.

Even when I did xcode-select --install it was telling me that I have already installed the command line tools, I had to go to the appStore to install Xcode manually (because the path /Applications/Xcode.app/Contents/Developer did not exist). After doing that, the path you've mentioned changed automatically and the installation worked.

@Donivanes
Copy link
Author

Donivanes commented Sep 20, 2024

Closing the issue. @harrisonhowardax thank you so much again 👏🏽

@jedrzejjurek
Copy link

after xcode manual installation and agreeing to license, I had to reboot again, then it worked flawlessly 👌 after hours of research that finally helped, thanks @harrisonhowardax

@FominSergiy
Copy link

Chime-in here as well - I just deleted and reinstalled xcode tools and that worked for me.

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants