dashpay / platform

L2 solution for seriously fast decentralized applications for the Dash network
https://dashplatform.readme.io/docs/introduction-what-is-dash-platform
MIT License
72 stars 39 forks source link

`yarn install` fails on node v20 #1531

Closed coolaj86 closed 10 months ago

coolaj86 commented 1 year ago
  1. Clone repo
    git clone --depth=1 git@github.com:dashpay/platform.git ./dashpay-platform/
    pushd ./dashpay-platform/
  2. Install deps onto Ubuntu 22.04 LTS
    sudo apt install -y \
       build-essential \
       clang \
       cmake \
       g++ \
       gcc \
       libgmp-dev \
       libpython3.10-dev \
       libssl-dev \
       libzmq3-dev \
       pkg-config
    apt install -y \
       protobuf-compiler
  3. Install node@18
    curl https://webi.sh/node@20 | sh
    source ~/.config/envman/PATH.env
  4. Install platform
    corepack enable
    yarn install
  5. Experience the pain and sadness of the empty void...
# This file contains the result of Yarn building a package (protobufjs@npm:6.11.4)
# Script name: postinstall

node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^
TypeError [Error]: [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///mnt/dashstore/app/dashpay-platform/.yarn/unplugged/protobufjs-npm-6.11.4-af11968b80/node_modules/protobufjs/package.json" needs an import assertion of type "json"
    at load$1 (file:///mnt/dashstore/app/dashpay-platform/.pnp.loader.mjs:1458:17)
    at nextLoad (node:internal/modules/esm/hooks:833:28)
    at Hooks.load (node:internal/modules/esm/hooks:416:26)
    at handleMessage (node:internal/modules/esm/worker:168:24)
    at checkForMessages (node:internal/modules/esm/worker:117:28)
    at process.<anonymous> (node:internal/modules/esm/worker:136:5)
    at process.emit (node:events:514:28)
    at process.emit (/mnt/dashstore/app/dashpay-platform/.pnp.cjs:28770:25) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}

Node.js v20.9.0
pshenmic commented 1 year ago

I can see the same message on the node v18 on the fresh ubuntu instance, will be investigating

coolaj86 commented 1 year ago

Interesting, because once I switched node versions and reran it, it worked.

coolaj86 commented 1 year ago

I believe a new point release of v18 just came out, so it could be an npm-hosted static build (maybe the json protoc) that hasn't yet been republished.

pshenmic commented 11 months ago

https://github.com/dashpay/platform/pull/1562