passportxyz / passport

Passport allows users to prove their identity through a secure, decentralized UI
Other
996 stars 462 forks source link

[BUG] Cannot run repo setup instructions to get repo running locally. #1381

Open owocki opened 1 year ago

owocki commented 1 year ago

Overview When installing the passport repo locally, the following error is presented.

owocki@local /Users/owocki/Sites/passport~ % lerna init                                                                                                                                    (git)-[main] :

lerna notice cli v7.0.2
lerna ERR! Lerna has already been initialized for this repo.
lerna ERR! If you are looking to ensure that your config is up to date with the latest and greatest, run `lerna repair` instead

even though this is a new repo that has never had lerna init run on it before.

owocki@local /Users/owocki/Sites/passport~ % lerna bootstrap                                                                                                                               (git)-[main] :

ERR! bootstrap The "bootstrap" command was removed by default in v7, and is no longer maintained.
ERR! bootstrap Learn more about this change at https://lerna.js.org/docs/legacy-package-management

Steps To Reproduce

Follow the instructions on the README:

git clone https://github.com/gitcoinco/passport.git
cd passport
npm install --global lerna
lerna init
lerna bootstrap

on OS X.

Observed behavior Errors are thrown during lerna init and lerna bootstrap.

owocki@local /Users/owocki/Sites/passport~ % npm --version                                                                                                                                 (git)-[main] :
9.6.3
owocki@local /Users/owocki/Sites/passport~ % node --version                                                                                                                                (git)-[main] :
v16.20.0
owocki@local /Users/owocki/Sites~ % yarn --version                                                                                                                                       (git)-[master] :
1.22.19
owocki@local /Users/owocki/Sites~ % git clone https://github.com/gitcoinco/passport.git                                                                                                  (git)-[master] :

Cloning into 'passport'...
remote: Enumerating objects: 16787, done.
remote: Counting objects: 100% (3263/3263), done.
remote: Compressing objects: 100% (692/692), done.
remote: Total 16787 (delta 2714), reused 2883 (delta 2543), pack-reused 13524
Receiving objects: 100% (16787/16787), 16.58 MiB | 11.26 MiB/s, done.
Resolving deltas: 100% (11666/11666), done.
owocki@local /Users/owocki/Sites~ % cd passport                                                                                                                                          (git)-[master] :

owocki@local /Users/owocki/Sites/passport~ % npm install --global lerna                                                                                                                    (git)-[main] :

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@octokit/request-error@4.0.2',
npm WARN EBADENGINE   required: { node: '>= 18' },
npm WARN EBADENGINE   current: { node: 'v16.20.0', npm: '9.6.3' }
npm WARN EBADENGINE }

changed 583 packages in 3s

69 packages are looking for funding
  run `npm fund` for details
owocki@local /Users/owocki/Sites/passport~ % lerna init                                                                                                                                    (git)-[main] :

lerna notice cli v7.0.2
lerna ERR! Lerna has already been initialized for this repo.
lerna ERR! If you are looking to ensure that your config is up to date with the latest and greatest, run `lerna repair` instead
owocki@local /Users/owocki/Sites/passport~ % lerna repair                                                                                                                                  (git)-[main] :
lerna notice cli v7.0.2
lerna info versioning independent

 >  Lerna   Failed to run 14-0-6-remove-root from nx. This workspace is NOT up to date!

 >  Lerna   Cannot find module 'nx'

   Require stack:
   - /opt/homebrew/lib/node_modules/lerna/node_modules/nx/src/utils/package-json.js
   - /opt/homebrew/lib/node_modules/lerna/node_modules/nx/src/utils/nx-plugin.js
   - /opt/homebrew/lib/node_modules/lerna/node_modules/nx/src/config/workspaces.js
   - /opt/homebrew/lib/node_modules/lerna/node_modules/nx/src/devkit-exports.js
   - /opt/homebrew/lib/node_modules/lerna/node_modules/@nx/devkit/index.js
   - /opt/homebrew/lib/node_modules/lerna/dist/index.js
   - /opt/homebrew/lib/node_modules/lerna/dist/cli.js
   Pass --verbose to see the stacktrace.

owocki@local /Users/owocki/Sites/passport~ % lerna lerna bootstrap                                                                                                                         (git)-[main] :

ERR! lerna Unknown command "lerna"
ERR! lerna Did you mean clean?
owocki@local /Users/owocki/Sites/passport~ % lerna bootstrap                                                                                                                               (git)-[main] :

ERR! bootstrap The "bootstrap" command was removed by default in v7, and is no longer maintained.
ERR! bootstrap Learn more about this change at https://lerna.js.org/docs/legacy-package-management

Expected behavior No errors are thrown.

Additional context Let me know what else you need to diagnose this.

owocki commented 1 year ago
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@octokit/request-error@4.0.2',
npm WARN EBADENGINE   required: { node: '>= 18' },
npm WARN EBADENGINE   current: { node: 'v16.20.0', npm: '9.6.3' }
npm WARN EBADENGINE }

this seems suspicious.. but then again the readme specifies node should be v16.

Daveliuyabo commented 1 year ago

I have also encountered this issue and have tried many times but have not been successful in running it,have you solved it yet?

Daveliuyabo commented 1 year ago

Git clone the latest repo, and excute "yarn --unsafe-perm" cmd,then it worked for me. os: linux Version: node v20.3.1 npm 9.7.2 yarn 1.22.19

nasko25 commented 12 months ago

I had the same problem and was able to fix it by installing lerna version 4.0.0 instead:

npm install --global lerna@^4.0.0
vporton commented 10 months ago

This problem is solved by npm install --global lerna@^4.0.0, but another problem appears:

$ lerna bootstrap 
lerna notice cli v4.0.0
lerna info versioning independent
lerna info bootstrap root only
node:internal/errors:513
      throw error;
      ^

TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received an instance of Error
    at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
    at ChildProcess.drain (/home/porton/.nvm/versions/node/v21.5.0/lib/node_modules/lerna/node_modules/@lerna/child-process/index.js:138:24)
    at Object.onceWrapper (node:events:634:26)
    at ChildProcess.emit (node:events:531:35)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v21.5.0
vporton commented 10 months ago

but another problem appears

This problem is solved by using an old version of Node: nvm use v16.16.0.