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

pnpm install fails on m1 mac [Fixed with xcode-select reinstall] #1146

Closed
santekotturi opened this issue Dec 17, 2024 · 8 comments
Closed

pnpm install fails on m1 mac [Fixed with xcode-select reinstall] #1146

santekotturi opened this issue Dec 17, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@santekotturi
Copy link

I've spent the last 6 hours trying to get around this

same error with both:
pnpm install and pnpm install -w --include=optional sharp

│   LIBTOOL-STATIC Release/opus.a
│   CXX(target) Release/obj.target/opus/src/node-opus.o
│ In file included from <built-in>:495:
│ <command line>:19:14: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]
│    19 | #define POSIX,__STDC_FORMAT_MACROS 1
│       |              ^
│ In file included from ../src/node-opus.cc:1:
│ /Users/santekotturi/Developer/forecast/eliza/node_modules/node-addon-api/napi.h:14:10: fatal error: 'functional' …
│    14 | #include <functional>
│       |          ^~~~~~~~~~~~
│ 1 warning and 1 error generated.
│ make: *** [Release/obj.target/opus/src/node-opus.o] Error 1
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack at ChildProcess.<anonymous> (/Users/santekotturi/.local/share/pnpm/global/5/.pnpm/[email protected]/node_…
│ gyp ERR! System Darwin 24.1.0
│ gyp ERR! command "/Users/santekotturi/.nvm/versions/node/v23.4.0/bin/node" "/Users/santekotturi/.local/share/pnpm…
│ gyp ERR! cwd /Users/santekotturi/Developer/forecast/eliza/node_modules/@discordjs/opus
│ gyp ERR! node -v v23.4.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/santekotturi/.nvm/versions/node/v23.4.0/bin/node /Users/…
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/santekotturi/Developer/forecast/eliza/node_module…
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1101:16)
│ node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
│ node-pre-gyp ERR! System Darwin 24.1.0
│ node-pre-gyp ERR! command "/Users/santekotturi/.nvm/versions/node/v23.4.0/bin/node" "/Users/santekotturi/Develope…
│ node-pre-gyp ERR! cwd /Users/santekotturi/Developer/forecast/eliza/node_modules/@discordjs/opus
│ node-pre-gyp ERR! node -v v23.4.0
│ node-pre-gyp ERR! node-pre-gyp -v v0.4.5
│ node-pre-gyp ERR! not ok 

always using rm -rf node_modules & rm pnpm-lock.yaml between each try.

node v23.4.0
tried downgrading to v20.x
pnpm v9.9.0

also tried brew install opus
macOS 15.1
XCode 16.2

on:
% git status >> HEAD detached at v0.1.6-alpha.1

Potentially related to:
#1041
#215

@santekotturi santekotturi added the bug Something isn't working label Dec 17, 2024
@oxSaturn
Copy link
Contributor

Have you tried xcode-select --install to have C++ compiler installed? I'm on m2, thought I ran into a similar issue (don't remember the exact issue) when I was trying eliza first time, and running xcode-select --install got it fixed for me as far as I can remember.

@santekotturi
Copy link
Author

Yea, I ran that, I've got a macos 15.2 update waiting for me, maybe that plays better with Xcode 16.2... will report back

@santekotturi
Copy link
Author

macos 15.2 updated, all xcode tool updates made. still same error.

This discordjs/opus connects having homebrew python3.12 in your path (which I do) discordjs/opus#145 (comment)

Curious what anyone else has for

python3 --version
which python3

@santekotturi
Copy link
Author

Had to uninstall xcode-select and reinstall ¯_(ツ)_/¯

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

that gets us: node_modules/@discordjs/opus: Running install script, done in 30.1s

@santekotturi santekotturi changed the title pnpm install fails on m1 mac pnpm install fails on m1 mac [Fixed with xcode-select reinstall] Dec 17, 2024
@rossixiluo
Copy link

I have the same issue. Have you resolved? Thanks.

@0xTenable
Copy link

Have the same issue as well, but for node-llama-cpp on M1 macbook

@Buooy
Copy link

Buooy commented Dec 22, 2024

Have the same issue as well, but for node-llama-cpp on M1 macbook

If you are coming from intel to silicon chip. one of the most common problems is porting over node and running it with rosetta. A lot of the AI packages are going to break.

1. Firstly, check if you are running a node version that's for x64 or arm...
node -p "process.arch"

You are looking for arm64. If you are on x64, you need to delete and reinstall node

2. Delete and reinstall node v23 (for this repo)

GLHF

@Zezzzzz
Copy link

Zezzzzz commented Dec 24, 2024

Have the same issue as well, but for node-llama-cpp on M1 macbook

env /usr/bin/arch -arm64 /bin/zsh —-login

Run the following to switch to arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants