lyft / clutch

Extensible platform for infrastructure management

Home Page:https://clutch.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document or support building with node 17

jpeach opened this issue · comments

Description

If you are following the local build instructions, it tells you to install node. However IIUC, the javascript dependencies are explicitly pinned to node 16:

frontend/package.json:    "node": ">=16.0.0 <17",

Homebrew currently defaults to installing node 17, though there is a compatibility node 16 package (that requires you to explicitly install and link a different package).

Expected Behavior

Actual Behavior

node errors out if you follow the instructions:

 % make
tools/compile-protos.sh -c "/Users/jpeach/upstream/clutch/api"
info: compiling go
/Users/jpeach/upstream/clutch/api/api/v1
/Users/jpeach/upstream/clutch/api/assets/v1
/Users/jpeach/upstream/clutch/api/audit/v1
/Users/jpeach/upstream/clutch/api/authn/v1
/Users/jpeach/upstream/clutch/api/authz/v1
/Users/jpeach/upstream/clutch/api/aws/dynamodb/v1
/Users/jpeach/upstream/clutch/api/aws/ec2/v1
/Users/jpeach/upstream/clutch/api/aws/kinesis/v1
/Users/jpeach/upstream/clutch/api/bot/slackbot/v1
/Users/jpeach/upstream/clutch/api/chaos/experimentation/v1
/Users/jpeach/upstream/clutch/api/chaos/redisexperimentation/v1
/Users/jpeach/upstream/clutch/api/chaos/serverexperimentation/v1
/Users/jpeach/upstream/clutch/api/config/gateway/v1
/Users/jpeach/upstream/clutch/api/config/middleware/accesslog/v1
/Users/jpeach/upstream/clutch/api/config/module/bot/slackbot/v1
/Users/jpeach/upstream/clutch/api/config/module/chaos/experimentation/xds/v1
/Users/jpeach/upstream/clutch/api/config/module/chaos/redisexperimentation/v1
/Users/jpeach/upstream/clutch/api/config/module/chaos/serverexperimentation/v1
/Users/jpeach/upstream/clutch/api/config/module/featureflag/v1
/Users/jpeach/upstream/clutch/api/config/module/feedback/v1
/Users/jpeach/upstream/clutch/api/config/module/proxy/v1
/Users/jpeach/upstream/clutch/api/config/module/sourcecontrol/v1
/Users/jpeach/upstream/clutch/api/config/service/auditsink/slack/v1
/Users/jpeach/upstream/clutch/api/config/service/audit/v1
/Users/jpeach/upstream/clutch/api/config/service/authn/v1
/Users/jpeach/upstream/clutch/api/config/service/authz/v1
/Users/jpeach/upstream/clutch/api/config/service/aws/v1
/Users/jpeach/upstream/clutch/api/config/service/bot/v1
/Users/jpeach/upstream/clutch/api/config/service/chaos/experimentation/terminator/v1
/Users/jpeach/upstream/clutch/api/config/service/db/postgres/v1
/Users/jpeach/upstream/clutch/api/config/service/envoyadmin/v1
/Users/jpeach/upstream/clutch/api/config/service/github/v1
/Users/jpeach/upstream/clutch/api/config/service/k8s/v1
/Users/jpeach/upstream/clutch/api/config/service/sourcegraph/v1
/Users/jpeach/upstream/clutch/api/config/service/temporal/v1
/Users/jpeach/upstream/clutch/api/config/service/topology/v1
/Users/jpeach/upstream/clutch/api/core/envoy/v1
/Users/jpeach/upstream/clutch/api/core/project/v1
/Users/jpeach/upstream/clutch/api/envoytriage/v1
/Users/jpeach/upstream/clutch/api/featureflag/v1
/Users/jpeach/upstream/clutch/api/feedback/v1
/Users/jpeach/upstream/clutch/api/healthcheck/v1
/Users/jpeach/upstream/clutch/api/k8s/v1
/Users/jpeach/upstream/clutch/api/project/v1
/Users/jpeach/upstream/clutch/api/proxy/v1
/Users/jpeach/upstream/clutch/api/resolver/aws/v1
/Users/jpeach/upstream/clutch/api/resolver/k8s/v1
/Users/jpeach/upstream/clutch/api/resolver/v1
/Users/jpeach/upstream/clutch/api/sourcecontrol/github/v1
/Users/jpeach/upstream/clutch/api/sourcecontrol/v1
/Users/jpeach/upstream/clutch/api/sourcegraph/v1
/Users/jpeach/upstream/clutch/api/timeseries/v1
/Users/jpeach/upstream/clutch/api/topology/v1
/Users/jpeach/upstream/clutch/backend/internal/test/pb/test.proto
info: compiling javascript bundle
OK
./build/bin/yarn.sh --cwd frontend install --frozen-lockfile
yarn install v1.22.11
[1/5] 🔍  Validating package.json...
error @clutch-sh/clutch@0.1.0: The engine "node" is incompatible with this module. Expected version ">=16.0.0 <17". Got "17.5.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
make: *** [yarn-install] Error 1

Version
7962bdb

Other Context

Downgrading node seems to make the build work:

% brew remove node
% brew install node@16
% brew link --overwrite node@16

One thing I've found to make this convenient is you can use nvm to be able to quickly switch between node versions without having to overwrite / reinstall every time. For example once you have nvm set up you can use nvm use 16 to quickly switch from 17 to 16 inside that shell, then when nvm use 17 or close the window to switch back. I know this isn't a real solution to the problem but just thought I'd point this out since I have found it to be useful.

https://github.com/nvm-sh/nvm/blob/master/README.md

commented

@jpeach would it be helpful to have a note earlier on in the local build guide around requiring node 16?

@jpeach would it be helpful to have a note earlier on in the local build guide around requiring node 16?

Yeh that would be helpful. I don't know how compatible the versions are - is it reasonable to remove the version check?