Agoric / documentation

User documentation
https://agoric.com/documentation/
Apache License 2.0
15 stars 39 forks source link

document node version policy: LTS (and note v14 vs M1) #627

Closed kennyrowe closed 10 months ago

kennyrowe commented 2 years ago

Describe the bug

When building the SDK with a mac M1 the final build step fails

To Reproduce

Steps to reproduce the behavior:

  1. Using Node 14.15
  2. Followed instructions for building with apple silicon (ie, install canvas)
  3. yarn install
  4. yarn build
  5. error
    internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^
    Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@endo/init'

Platform Environment

Additional context

Tried adding package with yarn add @endo/init and got

yarn add v1.22.15
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
dckc commented 2 years ago

@kennyrowe found a work-around: use the x86 emulator feature of the terminal app.

mhofman commented 2 years ago
  1. Using Node 14.15

Node 14 is not supported on M1

dckc commented 2 years ago

Node 14 is not supported on M1

where do we / should we document that, @mhofman ?

https://agoric.com/documentation/getting-started/before-using-agoric.html currently says 14.15.0 or higher.

mhofman commented 2 years ago

It's a Node.js limitation, not an agoric-sdk limitation.

dckc commented 2 years ago

@kennyrowe try with node 16 and without the x86 emulator, please?

tgrecojs commented 2 years ago

Node 14 is not supported on M1

Node v14 has worked fine when building the sdk on an m1 machine. I'm running v14.17.6 but i can confirm it worked with other v14 versions as well.

I took a minute to reproduce installing and building from a new repo and can confirm that everything succeeded without issue.

~[agoric-sdk-repro] % node -v
v14.17.6
~[agoric-sdk-repro] % agoric --version
0.13.21
~[agoric-sdk-repro] % yarn -V
yarn install v1.22.15
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
success Already up-to-date.
$ patch-package
patch-package 6.2.2
Applying patches...
@lerna/conventional-commits@3.18.5 ✔
@lit/reactive-element@1.0.1 ✔
acorn@7.4.1 ✔
depd@1.1.2 ✔
express@4.17.1 ✔
external-editor@3.1.0 ✔
lit@2.0.2 ✔
lit-element@3.0.1 ✔
lit-html@2.0.1 ✔
node-fetch@2.6.7 ✔
✨  Done in 0.61s.
tgrecojs commented 2 years ago

seeing this issue now Agoric/agoric-sdk#4460 which clarifies agoric-sdk's support for node v14 🤦‍♂️ not sure if it's specific to docker but curious as to whether this is still valid as an open issue, better suited as a documentation task.... 🤷‍♂️ hope its useful feedback nonetheless 🙂

mhofman commented 2 years ago

seeing this issue now Agoric/agoric-sdk#4460 which clarifies agoric-sdk's support for node v14 🤦‍♂️ not sure if it's specific to docker but curious as to whether this is still valid as an open issue, better suited as a documentation task.... 🤷‍♂️ hope its useful feedback nonetheless 🙂

I'm not sure I follow. Agoric/agoric-sdk#4460 was because Agoric/agoric-sdk#4420, which was merged after this issue was opened, introduced a dev dependency that has a higher node version requirement, so we bumped up our CI image.

I'm not sure which arch or from where you installed node.js, but the official package for Node 14 does not support the M1 architecture, only the x86 emulation. That is nothing specific to this repo.

The TLDR is that we still support the latest Node 14 and 16 LTS, for platforms which are officially supported. I agree we should probably remove the .15 minor specifier from documentations, and simply refer to latest LTS.

tgrecojs commented 2 years ago

I'm not sure I follow. Agoric/agoric-sdk#4460 was because Agoric/agoric-sdk#4420, which was merged after this issue was opened, introduced a dev dependency that has a higher node version requirement, so we bumped up our CI image.

Ah, sorry for misinterpreting. My knowledge of ARM vx. x86 arch only begun when getting this M1 so apologies for being so green.

I'm not sure which arch or from where you installed node.js, but the official package for Node 14 does not support the M1 architecture, only the x86 emulation. That is nothing specific to this repo.

I installed node via NVM. Running the node -p process.arch prints arm64. Below are some relevant contents i got from inspecting process within my terminals node repl.

  arch: 'arm64',
  platform: 'darwin',
  release: {
    name: 'node',
    lts: 'Fermium',
    sourceUrl: 'https://nodejs.org/download/release/v14.17.6/node-v14.17.6.tar.gz',
    headersUrl: 'https://nodejs.org/download/release/v14.17.6/node-v14.17.6-headers.tar.gz'
  },

Thanks for all the info here! @mhofman

Tartuffo commented 2 years ago

Devs on M1 need to use V16.

dtribble commented 2 years ago

node 14.18 seems to work. I cloned agoric-sdk again. yarn && yarn build succeeded.

Tyrosine22 commented 1 year ago

Because we cover the installation of Node in the Getting Started section, I'll handle this when I revise that section... a revision which is scheduled for the relatively near future.

dckc commented 10 months ago

This just about covers it:

node --version # LTS version such as 18.16.0

https://docs.agoric.com/guides/getting-started/#install-node-js

Ideally, the text above it would use the same "LTS version such as 18.16.0" wording, but it says "We recommend installing the LTS version of node 18" as if there are non-LTS versions of node 18 and as if we don't recommend v20 once it becomes LTS.