question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error occured: Couldn't find ethers-v5.

See original GitHub issue

Hi guys. I try use this library in my project and I get this error:

npm run build-contracts-src

> api@0.0.1 build-contracts-src /home/damian/Documents/work/kargain-nft/API
> typechain --target=ethers-v5 --out-dir src/contracts ../Contract/bin/contracts/Kargain.json

Error occured:  Couldn't find ethers-v5. Tried loading: @typechain/ethers-v5, typechain-target-ethers-v5, /home/damian/Documents/work/kargain-nft/API/ethers-v5.
Perhaps you forgot to install @typechain/ethers-v5?
Run with --show-stack-traces to see the full stacktrace

my package.json

{
  "name": "api",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "build-contracts-src": "typechain --target=ethers-v5 --out-dir src/contracts ../Contract/bin/contracts/Kargain.json",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },
  "dependencies": {
    "@nestjs/common": "^7.5.1",
    "@nestjs/core": "^7.5.1",
    "@nestjs/platform-express": "^7.5.1",
    "@nestjs/swagger": "^4.8.0",
    "dotenv": "^10.0.0",
    "ethers": "^5.3.1",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^6.6.3",
    "swagger-ui-express": "^4.1.6",
  },
  "devDependencies": {
    "@nestjs/cli": "^7.5.1",
    "@nestjs/schematics": "^7.1.3",
    "@nestjs/testing": "^7.5.1",
    "@typechain/ethers-v5": "^4.0.0",
    "@types/express": "^4.17.8",
    "@types/jest": "^26.0.15",
    "@types/node": "^14.14.6",
    "@types/supertest": "^2.0.10",
    "@typescript-eslint/eslint-plugin": "^4.6.1",
    "@typescript-eslint/parser": "^4.6.1",
    "eslint": "^7.12.1",
    "eslint-config-prettier": "^6.15.0",
    "eslint-plugin-prettier": "^3.1.4",
    "jest": "^26.6.3",
    "prettier": "^2.1.2",
    "supertest": "^6.0.0",
    "ts-jest": "^26.4.3",
    "ts-loader": "^8.0.8",
    "ts-node": "^9.0.0",
    "tsconfig-paths": "^3.9.0",
    "typechain": "^5.0.0",
    "typescript": "^4.0.5"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sc0Vucommented, Jun 16, 2021

I have same issue after update to latest version of typechain (upgrade from v4 to v5). And I also installed @typechain/ethers-v5.

The weird thing is I fix this issue with install @typechain/ethers-v5@7.0.1, which is the latest version. Not sure what happened, try to install @typechain/ethers-v5@7.0.1.

1reaction
aspierscommented, Feb 15, 2022

In case anyone comes here looking for a solution and you are using monorepos, check out #620.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Couldn't find ethers-v5 · Issue #423 - GitHub
Finally I found out that ethers-v5 was loading the typechain library in its index.js , but instead of receiving the package when doing...
Read more >
@typechain/ethers-v5 - npm
@typechain/ethers-v5. TypeScript icon, indicating that this package has built-in type declarations. 10.2.0 • Public • Published 13 days ago.
Read more >
Perhaps you forgot to install @typechain/ethers-v5? - Zenn
An unexpected error occurred: Error: Couldn't find ethers-v5. Tried loading: @typechain/ethers-v5, typechain-target-ethers-v5, ...
Read more >
typechain --target ethers-v5 is not recognized as an internal ...
json'",. When I try to run this I always have this error (I'm on windows) any idea ? typechain --target ethers ...
Read more >
ethers-io/Lobby - Gitter
Hi @ricmoo, is there a change in ethers.utils.bigNumberify api in v5? Looks like the util function isn't available. Also the constructor new ethers....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found