Open daveseah opened 1 year ago
Ben is using an Intel MacBook Pro:
arch: i386
nvm version: v10.22.0
Joshua is using an M2 MacBook Pro:
arch: arm64
nvm version: v14.18.1
Node v14.18 is compatible with Apple Silicon, but he is not using the version specified in .nvmrc
which is v10.22.0
Sri is using an M1 MacBook Pro
arch: i386
nvm version: v14.18.1
Ooops! I did a nvm use
then npm ci
to make sure it still worked. Though, this might not apply to our package-lock.json
file because it's been frozen and changes only when we are adding/removing packages via npm install
.
Every time I launch a shell, it's using the default node version set by nvm alias default v14.18.1
, which is handy as a default but means we have to be careful about what version is in place. There's a way I can make VSCODE run a custom shell task defined in the workspace settings, so I'll have to try that...
I added a check for the node version to brunch-server.js
, see updated testing.
Added additional warning when there is an architecture mismatch, which catches the case when netcreate is run outside of the integrated terminal. The check does not prevent the code from running as does the node version check.
THIS PULL REQUEST SHOULD NOT BE MERGED WITHOUT TESTING ON MULTIPLE PLATFORMS BY MULTIPLE DEVS
The 2018 build of NetCreate uses an older version of node (set in
.nvmrc
asv10.22.0
). This version does not officially support Apple Silicon (e.g. M1, M2 processors), but we don't want to update it yet because there are many packages that also need updating.Why is this important?
Many of the packages in NPM have native code elements that have dependencies to a processor and operating system platform, and they often also tied to the nodejs major version. Many the packages used for NetCreate predate Apple Silicon and may not compile correctly, causing unusual errors.
TESTING ARCHITECTURE
This requires an Apple Silicon Mac (M1, M2, etc)
arch
. If it saysi386
then it's workingNext, make sure NetCreate is using the correct NodeJS architecture. Since the processor type has changed, it's likely that the codebase may need to be repulled.
cd build
nvm version
to see what version of node is running. It should bev10.22.0
. If it isn't the case then typenvm use
.npm ci
to reload all the library dependencies set inpackage-lock.json
and see if there are errors.TESTING NODE VERSION MISMATCH
When the
brunch-server.js
file runs, it now checks that thenode version
output matches what is inside of.nvmrc
and will halt the server with instructions on what to do.TECHNICAL INFORMATION
This patch adds the following settings to
netcreate-2018.code-workspace
The effect of these settings is to define a profile for osx machines "x86 zsh" which will execute the
arch
command that tells Rosetta (apple's Intel processor emulator) to switch to X86_64 mode when opening the integrated terminal inside of Visual Studio Code. The second setting tells VSC to use this new profile for every new one.This does not affect other terminal windows, but you can do the same thing by issuing the
arch
command BEFORE you runnpm use && npm ci
when starting it up for the first time in a terminal window: