Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

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

Closed
alcuadrado opened this issue Oct 16, 2020 · 6 comments
Closed

Comments

@alcuadrado
Copy link
Contributor

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.

@davidmurdoch
Copy link
Member

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.

@davidmurdoch
Copy link
Member

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

@jjgonecrypto
Copy link

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?

@alcuadrado
Copy link
Contributor Author

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.

@drptbl
Copy link

drptbl commented Oct 22, 2020

@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

@davidmurdoch
Copy link
Member

Fixed in 2.13.1 https://www.npmjs.com/package/ganache-core/v/2.13.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants