Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI fails because of Nodejs version change in GH Action's ubuntu image #142

Closed
rtang03 opened this issue Nov 28, 2020 · 1 comment · Fixed by #141
Closed

CI fails because of Nodejs version change in GH Action's ubuntu image #142

rtang03 opened this issue Nov 28, 2020 · 1 comment · Fixed by #141
Labels
dependencies Pull requests that update a dependency file
Projects

Comments

@rtang03
Copy link
Owner

rtang03 commented Nov 28, 2020

"Default Node.JS will be switched to 14.x on all platforms", on Oct 29, 2020. => break CI

Even using nvm does not work.

The grpc binary fail to find.

@rtang03 rtang03 added this to To do in deployments via automation Nov 28, 2020
@rtang03 rtang03 added the dependencies Pull requests that update a dependency file label Nov 28, 2020
@rtang03
Copy link
Owner Author

rtang03 commented Nov 29, 2020

The grpc binary in CI environment. has problem, since Nov, 2020. The CI environment change the default Nodejs version from v12 to v14

This change breaks the CI.

Even we use "setup-node@v2-beta" with nodejs 12; during the Jest unit test, it attempts to use napi = 6 (i.e. Nodejs 14). The grpc binary will translate the {node_api} into "node-v83". I GUESS that there is some configuration in the Github Action docker image, which defines the used of Node 14 (maybe .npmrc, or something else; I did not check).

The error: cannot grpc C++ addon is located at. And, its installation location depends on n_api version
./lib/binding/{node_abi}-{platform}-{arch}.

In order to workaround it, we use nvm to install nodejs v12, and do the monorepo installation. And, then switch to nodejs v14, to rebuild grpc library. After "./lib/binding/node-v83-darwin-x64/grpc_node.node" is create, resume Nodejs v12.

Because Hyperledger Fabric v2.2 client has a strict engine requirement for Nodejs v12.16.1; cannot use Nodejs V14. Don't attempt to upgrade it.

# ci.yaml
          curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
          export NVM_DIR="$HOME/.nvm"
          [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
          [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
          nvm --version
          nvm install v12.16.1
          nvm use v12.16.1
          yarn install
          nvm install v14.0.0
          nvm use v14.0.0
          npm rebuild grpc
          nvm use v12.16.1

For debugging purpose, can use below command to find out napi version:

          yarn config list
          npm version
          yarn versions

@rtang03 rtang03 changed the title fail: CI fails because of Nodejs version change in ci.yaml fail: CI fails because of Nodejs version change in Github Action's ubuntu hosted image Nov 29, 2020
@rtang03 rtang03 changed the title fail: CI fails because of Nodejs version change in Github Action's ubuntu hosted image fail: CI fails because of Nodejs version change in GH Action's ubuntu image Nov 29, 2020
@rtang03 rtang03 moved this from To do to In progress in deployments Nov 30, 2020
@rtang03 rtang03 linked a pull request Nov 30, 2020 that will close this issue
deployments automation moved this from In progress to Done Nov 30, 2020
@rtang03 rtang03 changed the title fail: CI fails because of Nodejs version change in GH Action's ubuntu image CI fails because of Nodejs version change in GH Action's ubuntu image Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
deployments
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant