trufflesuite/ganache

The latest version can't be installed with node v12.19.0 and npm v6.14.8

alcuadrado opened this issue ยท 6 comments

Hey @davidmurdoch,

I've seen multiple reports of npm failing to install ganache-core lately. Initially I couldn't reproduce it until I switched to node 12.

This is a pretty weird error, as running npm init -y && npm i ganache-core doesn't fail. But if you have a project with a package.json and package-lock.json that already have ganache-core, you get this error:

pato@pmbp /t/npmproject-3> npm i
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/eth-sig-util/ethereumjs-abi@git+https:/github.com/ethereumjs/ethereumjs-abi.git" as it does not contain a package.json file.

This may be a bug in npm/node, but you could avoid it by upgrading web3-provider-engine, as it doesn't use a git-based dependency anymore.

We haven't touched the ethereumjs/ethereumjs-abi repo in a long time, and it does contain a package.json. So I'm inclined to think that it's npm's fault.

Hm, thanks for opening this. I'll look into it!

I couldn't figure out web3-provider-engine's breaking changes regarding the Subscription provider, otherwise I would just update it.

Do you have more information to reproduce? I've been unable to do so.

It's currently inside our synthetix bundle now (v2.30.2-ovm)

Try cloning and installing this: https://github.com/Synthetixio/synthetix-cli - you should see it pop up immediately.

I wonder if the usage of npm-shrinkwrap.json instead of a lockfile in ganache is a problem?

Something I noticed from the latest release is that the shrink wrap file has been generated with npm 7, maybe those are incompatible/trigger a bug in npm 6.

@davidmurdoch @alcuadrado I was able to fix this by removing:
ethereumjs-abi@ prefix from:
ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git (all occurencies)
which results in:
git+https://github.com/ethereumjs/ethereumjs-abi.git
in package-lock.json (in your case it would be npm-shrinkwrap.json)

Everything seems to work now.

To reproduce you can do these steps:

  1. git pull https://github.com/Synthetixio/kwenta
  2. git checkout update-synthetixiojs
  3. npm install => fails with error above

now if you open package-lock.json and edit (as described above):
ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git (all occurencies)
to
git+https://github.com/ethereumjs/ethereumjs-abi.git
and run npm install again, everything works and package-lock.json is not modified after it.

Created PR for this with a fix: #653