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

Errors yarn installing on an M2 Macbook Pro #2680

Closed
JoshuaKGoldberg opened this issue Jan 17, 2023 · 4 comments
Closed

Errors yarn installing on an M2 Macbook Pro #2680

JoshuaKGoldberg opened this issue Jan 17, 2023 · 4 comments

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Jan 17, 2023

Posting from #2676 (comment) as requested by @andrewbranch - thanks for looking into these errors! πŸ˜„

Copying the last few lines of running yarn locally:

➀ YN0009: β”‚ canvas@npm:2.6.1 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/1_/pn8_jg_93cqdnkyswmmr5sxm0000gn/T/xfs-2898ede3/build.log)
➀ YN0009: β”‚ fsevents@patch:fsevents@npm%3A1.2.11#~builtin<compat/fsevents>::version=1.2.11&hash=18f3a7 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/1_/pn8_jg_93cqdnkyswmmr5sxm0000gn/T/xfs-f284f23b/build.log)
➀ YN0009: β”‚ sharp@npm:0.28.1 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/1_/pn8_jg_93cqdnkyswmmr5sxm0000gn/T/xfs-5a1931c9/build.log)
➀ YN0008: β”‚ gatsby-cli@npm:3.8.0 must be rebuilt because its dependency tree changed
➀ YN0008: β”‚ gatsby@npm:3.8.1 [5df2e] must be rebuilt because its dependency tree changed
➀ YN0000: β”” Completed in 6s 451ms
/private/var/folders/1_/pn8_jg_93cqdnkyswmmr5sxm0000gn/T/xfs-2898ede3/build.log (canvas@npm:2.6.1)
# This file contains the result of Yarn building a package (canvas@npm:2.6.1)
# Script name: install

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@18.7.0 | darwin | arm64
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp info check checked for "/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release/canvas.node" (not found)
node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v108-darwin-unknown-arm64.tar.gz
node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v108-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v108-darwin-unknown-arm64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@18.7.0 (node-v108 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp http 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v108-darwin-unknown-arm64.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@18.7.0 | darwin | arm64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@18.7.0 | darwin | arm64
gyp info find Python using Python version 3.10.6 found at "/opt/homebrew/opt/python@3.10/bin/python3.10"
(node:12125) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /opt/homebrew/opt/python@3.10/bin/python3.10
gyp info spawn args [
gyp info spawn args   '/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/gyp/gyp_main.py',
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   '/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/josh/Library/Caches/node-gyp/18.7.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/josh/Library/Caches/node-gyp/18.7.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/josh/repos/TypeScript-Website/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/josh/Library/Caches/node-gyp/18.7.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/josh/repos/TypeScript-Website/node_modules/canvas',
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 node-gyp@5.1.0
gyp info using node@18.7.0 | 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:
In file included from ../src/backend/Backend.h:6:
../../nan/nan.h:2536:8: warning: 'SetAccessor' is deprecated: Do signature check in accessor [-Wdeprecated-declarations]
  tpl->SetAccessor(
       ^
/Users/josh/Library/Caches/node-gyp/18.7.0/include/node/v8-template.h:837:3: note: 'SetAccessor' has been explicitly marked deprecated here
  V8_DEPRECATED("Do signature check in accessor")
  ^
/Users/josh/Library/Caches/node-gyp/18.7.0/include/node/v8config.h:460:35: note: expanded from macro 'V8_DEPRECATED'
# define V8_DEPRECATED(message) [[deprecated(message)]]
                                  ^
In file included from ../src/backend/Backend.cc:1:
In file included from ../src/backend/Backend.h:6:
In file included from ../../nan/nan.h:2884:
../../nan/nan_typedarray_contents.h:34:43: error: no member named 'GetContents' in 'v8::ArrayBuffer'
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                  ~~~~~~~~^
../src/backend/Backend.cc:111:10: warning: address of stack memory associated with local variable 'msg' returned [-Wreturn-stack-address]
  return msg.c_str();
         ^~~
2 warnings and 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.onExit (/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/Users/josh/.nvm/versions/node/v18.7.0/bin/node" "/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
gyp ERR! cwd /Users/josh/repos/TypeScript-Website/node_modules/canvas
gyp ERR! node -v v18.7.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/josh/.nvm/versions/node/v18.7.0/bin/node /Users/josh/repos/TypeScript-Website/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/josh/repos/TypeScript-Website/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Darwin 21.6.0
node-pre-gyp ERR! command "/Users/josh/.nvm/versions/node/v18.7.0/bin/node" "/Users/josh/repos/TypeScript-Website/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/josh/repos/TypeScript-Website/node_modules/canvas
node-pre-gyp ERR! node -v v18.7.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/josh/.nvm/versions/node/v18.7.0/bin/node /Users/josh/repos/TypeScript-Website/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/josh/repos/TypeScript-Website/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
/private/var/folders/1_/pn8_jg_93cqdnkyswmmr5sxm0000gn/T/xfs-5a1931c9/build.log (sharp@npm:0.28.1)
# This file contains the result of Yarn building a package (sharp@npm:0.28.1)
# Script name: install

sharp: Using existing vendored libvips v8.10.6
prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@18.7.0 | darwin | arm64
gyp info find Python using Python version 3.10.6 found at "/opt/homebrew/opt/python@3.10/bin/python3.10"
(node:12359) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /opt/homebrew/opt/python@3.10/bin/python3.10
gyp info spawn args [
gyp info spawn args   '/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/gyp/gyp_main.py',
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   '/Users/josh/repos/TypeScript-Website/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/josh/Library/Caches/node-gyp/18.7.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/josh/Library/Caches/node-gyp/18.7.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/josh/repos/TypeScript-Website/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/josh/Library/Caches/node-gyp/18.7.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/josh/repos/TypeScript-Website/node_modules/sharp',
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 spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  LIBTOOL-STATIC Release/nothing.a
env: python: No such file or directory
make: *** [Release/nothing.a] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/Users/josh/.nvm/versions/node/v18.7.0/bin/node" "/Users/josh/repos/TypeScript-Website/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/josh/repos/TypeScript-Website/node_modules/sharp
gyp ERR! node -v v18.7.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

  • macOS Monterey
  • MacBook Air (M2, 2022)
@jakebailey
Copy link
Member

jakebailey commented Jan 17, 2023

I tested this on my M1 with Monterey and got similar results.

The python thing seems to be because macOS dropped python from the OS and so it's not in PATH anymore. I have a brew installed Python 3, but it only comes onto path as python3, so I was able to fix the second error with:

export PATH="/opt/homebrew/opt/python/libexec/bin:$PATH"

The other errors I've been able to fix by installing the libraries that the logs tell me are missing, which required brew install pixman cairo pango (but I think I had some others already installed).

I'm also running Node 16 versus 18; your logs seem to imply that there's a compiler error related to v8 headers which are Node specific. Maybe try downgrading to Node 16?

@andrewbranch
Copy link
Member

The website currently requires Node 14 (we have a Volta entry in the package.json) until we do something about #2473

@JoshuaKGoldberg
Copy link
Contributor Author

That worked, thanks!

export PATH="/opt/homebrew/opt/python/libexec/bin:$PATH"
nvm use 14

@orta
Copy link
Contributor

orta commented Feb 8, 2023

Should be fixed now πŸ‘πŸ»

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

4 participants