teambit / bvm

Bit version manager
Other
40 stars 13 forks source link

Installing bit on m1 causes architecture errors with Node.js #58

Closed ewapotorecka closed 1 year ago

ewapotorecka commented 2 years ago

Describe the bug

After installing (or updating to the newest version), when I try to run bit tag I get an error: Error: You installed esbuild on another platform than the one you're currently using. This won't work because esbuild is written with native code and needs to install a platform-specific binary executable.

For installing bit I've used the command from the documentation: npx @teambit/bvm install.

I've checked and Node.js is being installed in ~/.bvm/nodejs and it targets x64 instead of arm64, which is causing the issue.

Other bit commands also don't work correctly.

Steps to Reproduce

  1. Install bit on mac with m1
  2. Add a React component
  3. Run bit tag

Expected Behavior

After installing or updating bit, it uses the correct build of Node.js for m1 architecture.

Specifications

zkochan commented 2 years ago

As a workaround, you may use:

npx @teambit/bvm install --use-system-node
ewapotorecka commented 2 years ago

thank you, this will also work with bvm upgrade? And are you planning on fully supporting m1 in the near future and if yes when?

zkochan commented 2 years ago

Yes, it is supported by bvm upgrade. You can see the list of supported options by running bvm upgrade -h

I think m1 should be support already. It must be some bug.

GiladShoham commented 1 year ago

@giteden we have to document this issue

GiladShoham commented 1 year ago

please make sure you are using latest version of bvm (0.2.10 at the moment) (the npx is not always updating global bins) (so better to just install bvm globally) then run bvm upgrade --override and it will install the correct version according to your architecture. if the node that exist in the bvm folder is incorrect, you can delete the nodejs folder there before running the bvm upgrade. and bvm will re-fetch it. if it doesn't work, it usually means that your node version that is used to install bvm (the machine installed version of node) is not the arm64 version. you can check it by just running node -p 'process.arch' and make sure it prints arm64 if not, you need to uninstall node, and re-install a proper version of node.