zhinee
zhinee

Reputation: 135

Error:'darwin-x64' binaries cannot be used on the 'darwin-arm64v8' platform

I am facing this error when I am trying to do a git push on Intellj.
It's a similar issue to this one but opposite ( That one is 'darwin-x64' binaries cannot be used on the 'darwin-arm64v8')
I have tried all the solution from that post but the git push still throwing the same error.

Below is the error I recevied when I do a git push.

Error in "/Users/xxx/Projects/cpss/node_modules/gatsby-transform
er-sharp/gatsby-node.js": 'darwin-x64' binaries cannot be used on the
'darwin-arm64v8' platform. Please remove the 'node_modules/sharp' directory and
run 'npm install' on the 'darwin-arm64v8' platform.
Error:'darwin-x64' binaries cannot be used on the 'darwin-arm64v8' platform. 
Please remove the 'node_modules/sharp' directory and run 'npm install' on the 
'darwin-arm64v8' platform.

I have tried to delete the node_modules/sharp and run npm install but it does not work.

Can someone explains to me how can I run npm install on 'darwin-arm64v8' platform?
Thank you.

Upvotes: 0

Views: 1693

Answers (2)

木子李
木子李

Reputation: 1

delete the node_modules/sharp and run npm install --arch=arm64 --platform=darwin sharp

https://sharp.pixelplumbing.com/install#cross-platform

Upvotes: 0

Andru
Andru

Reputation: 6204

The answer here resolved it for me:

Run brew reinstall vips. Then delete the node_modules folder and install all dependencies again (with npm install or yarn).

Upvotes: 1

Related Questions