Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

UnhandledPromiseRejectionWarning: InvalidRepoVersionError: Incompatible repo versions. (IPFS-JS 0.55.3)-(Node Js 14.17.0) #3712

Closed
adam12121997 opened this issue Jun 10, 2021 · 2 comments · Fixed by #3718
Labels
need/triage Needs initial labeling and prioritization

Comments

@adam12121997
Copy link

I just learned about ipfs js, and the version I have installed is version 0.55.3 (https://www.npmjs.com/package/ipfs), besides I'm also using node js with version 14.17.0 (LTS) and MacOS BigSur 11.4

When I follow the tutorial on the link https://github.com/ipfs/js-ipfs/tree/master/examples/ipfs-101 I always get an error like this:

(node:9857) UnhandledPromiseRejectionWarning: InvalidRepoVersionError: Incompatible repo versions. Automatic migrations disabled. Please migrate the repo manually.
    at IpfsRepo.open (/Users/username/Documents/program/ipfs-node-10/node_modules/ipfs-repo/src/index.js:142:17)
    at async loadRepo (/Users/username/Documents/program/ipfs-node-10/node_modules/ipfs-core/src/components/storage.js:74:5)
    at async Function.start (/Users/username/Documents/program/ipfs-node-10/node_modules/ipfs-core/src/components/storage.js:54:41)
    at async Object.create (/Users/username/Documents/program/ipfs-node-10/node_modules/ipfs-core/src/components/index.js:223:21)
    at async main (/Users/username/Documents/program/ipfs-node-10/index.js:4:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9857) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9857) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

And here is the code from my index.js:

const IPFS = require('ipfs')

async function main () {
  const node = await IPFS.create()
  const version = await node.version()

  console.log('Version:', version.version)
  // ...
}

main()

And this is my package.json:

{
  "name": "ipfs-node-10",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "ipfs": "^0.55.3"
  }

Can you help me to find a solution to this problem?

@adam12121997 adam12121997 added the need/triage Needs initial labeling and prioritization label Jun 10, 2021
@welcome
Copy link

welcome bot commented Jun 10, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@mctrivia
Copy link

mctrivia commented Jun 13, 2021

i get the same error when I try on windows machine. Not sure if relevant but Go IPFS desktop was installed on this machine already tried with it turned off and on.

If i try on ubuntu 20 I don't get this error so maybe a windows issue or because node desktop was previously installed.

achingbrain added a commit that referenced this issue Jun 16, 2021
The recent js-ipfs-repo release changed how options are merged which
resulted in the wrong `autoMigrate` value being used.

Pass it in explicitly and add a test to prevent future regressions.

Fixes #3712
achingbrain added a commit that referenced this issue Jun 16, 2021
The recent js-ipfs-repo release changed how options are merged which resulted in the wrong `autoMigrate` value being used.

Pass it in explicitly and add a test to prevent future regressions.

Fixes #3712
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants