compound-finance / saddle

Ethereum Smart Contract Saddle
MIT License
78 stars 27 forks source link

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

Open cameel opened 3 years ago

cameel commented 3 years ago

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

bingen commented 2 years ago

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

My environment is:

edmulraney commented 2 years ago

Horrible work around:

cd node_modules/solidity-parser-antlr
npm run build
npm run copy-files
DBLTecnologia commented 2 years ago

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
neon-smart-contract-dev commented 2 years ago

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

irfanshaik11 commented 1 year ago

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!