Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Cannot find module '@babel/runtime/helpers/classCallCheck' #2225

@inherithandle

Description

@inherithandle

I'm working on Node v11.7.0 and web3.js 1.0.0-beta.38. I just wanted to do a simple test like:

// package.json
{
  "name": "localBlockchain",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "web3": "^1.0.0-beta.38"
  }
}
// web3test.js
var Web3 = require('web3')
var web3 = new Web3('HTTP://127.0.0.1:7545')
web3.eth.getAccounts().then(accounts => console.log(accounts));

but I've got the following error.

$ node web3test.js
internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module '@babel/runtime/helpers/classCallCheck'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/hello/Desktop/localBlockchain/node_modules/web3/dist/web3.cjs.js:5:39)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)

And I notice the above test code works well on web3.js 1.0.0-beta.37.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions