saddle icon indicating copy to clipboard operation
saddle copied to clipboard

Cannot find module 'solidity-parser-antlr/dist/index.cjs.js'. Please verify that the package.json has a valid "main" entry

Open cameel opened this issue 3 years ago • 5 comments

I wanted to try out the framework but I'm getting an error immediately after installing it with npm:

npm install eth-saddle
npx saddle help
Error: Cannot find module '/tmp/saddle/node_modules/solidity-parser-antlr/dist/index.cjs.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:347:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:560:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:913:27)
    at Function.Module._load (node:internal/modules/cjs/loader:772:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/tmp/saddle/node_modules/@compound-finance/sol-tracing-utils/src/collect_coverage_entries.ts:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/tmp/saddle/node_modules/@compound-finance/sol-tracing-utils/src/index.ts:34:1)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/tmp/saddle/node_modules/@compound-finance/sol-coverage/src/coverage_subprovider.ts:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)

I see that solidity-parser-antlr is now at 0.13.2 while package.json of the framework still refers to 0.4.11.

Environment

  • OS: Arch Linux
  • node.js version: v16.4.2
  • npm version: 7.17.0
  • saddle version: 0.1.24-alpha1 (this is what npm currently installs)

cameel avatar Jul 11 '21 17:07 cameel

I’m getting the same error, while trying to do saddle import.

My environment is:

  • OS: linux
  • node.js version: v16.8.0
  • npm version: 7.21.01
  • saddle version: 0.1.25

bingen avatar Oct 28 '21 10:10 bingen

Horrible work around:

cd node_modules/solidity-parser-antlr
npm run build
npm run copy-files

edmulraney avatar Nov 02 '21 13:11 edmulraney

Unfortunately @edmulraney solution didn't worked for me.

My environment is:

OS: Ubuntu 18
node.js version: v14.20.0
npm version: 8.15.1
saddle version: 0.1.25

DBLTecnologia avatar Aug 01 '22 11:08 DBLTecnologia

cd node_modules/solidity-parser-antlr npm i npm run build npm run copy-files

neon-smart-contract-dev avatar Sep 12 '22 06:09 neon-smart-contract-dev

hi, having this exact issue on a mac m1, @neon-smart-contract-dev and @edmulraney solution didn't work for me.

Pinging in case anyone has the answer!

irfanshaik11 avatar May 29 '23 02:05 irfanshaik11