OpenZeppelin / openzeppelin-test-environment

[Not actively maintained] One-line setup for blazing-fast smart contracts tests
https://docs.openzeppelin.com/test-environment
MIT License
90 stars 39 forks source link

npm install: cannot read property 'match' of undefined (from web3-utils?) #134

Closed joshlang closed 4 years ago

joshlang commented 4 years ago

PS C:\Users\Josh\source\repos\test123> npm install --save-dev @openzeppelin/test-environment yields this error output:

npm WARN deprecated ganache-core@2.11.0: this version has been deprecated due to an npm bug that creates a broken shrinkwrap file
npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Josh\AppData\Roaming\npm-cache\_logs\2020-08-05T15_53_52_614Z-debug.log

Using windows 10. node --version -> v12.18.3 npm --version -> 6.14.7

Prior stuff (basically just walking through your intro stuff)

npm init
npm install --save-dev @openzeppelin/cli
npm install --save-dev @openzeppelin/contracts
npm install --save-dev ganache-cli
npx openzeppelin init
npm install web3 @openzeppelin/contract-loader
npm install --save-dev @openzeppelin/test-environment

The debug log file is attached here:

2020-08-05T15_48_03_327Z-debug.log

joshlang commented 4 years ago

Also, package.json is as follows:

{
  "name": "test123",
  "version": "1.0.0",
  "description": "test123",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@openzeppelin/cli": "^2.8.2",
    "@openzeppelin/contracts": "^3.1.0",
    "ganache-cli": "^6.9.1"
  },
  "dependencies": {
    "@openzeppelin/contract-loader": "^0.6.1",
    "web3": "^1.2.11"
  }
}
joshlang commented 4 years ago

Well.

Never. Frickin'. Mind.

3 hours later... somebody changed something and it's installing now.

Current confidence level: 101%.

abcoathup commented 4 years ago

Hi @joshlang,

I'm sorry that you had this issue. I recommend using Windows Subsystem for Linux (WSL) on Window 10.
Whilst I previously developed smart contracts natively on Windows, it is much easier using WSL2 on Windows 10. https://forum.openzeppelin.com/t/solidity-smart-contract-development-on-windows/2110

If you have any questions, feel free to ask in the community forum: https://forum.openzeppelin.com/

joshlang commented 4 years ago

Hey hey!

Yep, already got it working, running vscode within an ubuntu context.

Pretty steep learning curve during the setup to figure that out, but... all good now. Thanks!

abcoathup commented 4 years ago

Great to hear.

It takes a little while to get WSL setup, but then you are using Linux which is what the ecosystem supports, so life gets a lot easier after that.