DEV Community

Cover image for Solve one problem a day
liamlo-dev
liamlo-dev

Posted on • Edited on

Solve one problem a day

3 November 2022

Installing nvm

Why: Have been using n, which is much easier to install and to use. However, since it is a npm package which may cause a circular dependency-like problem, I guess there is no harm to install nvm too. See more

Problem: Using brew as always, followed the instruction popped up.

Solution: Thanks to this,

  1. Add source $(brew --prefix nvm)/nvm.sh to ~/.zshrc
  2. Restart the terminal or source ~/.zshrc

4 November 2022

Reverting back to n

Why: Can't believe I am reverting back to n in only 1 day... CRANQ seems to be only working with n, seemingly because n always stores node in /usr/local/bin when nvm stores it in a user specific path (and with redirection), while CRANQ only recognizes /usr/local/bin

Lack of ETH

Why: Goerli is the only official testnet now after ETH Merge, as Rinkeby is depreciated.

Problem: Due to the above reason, Goerli gas fee 10x in 2 months causing contract deployment to be very "expensive". Talked to some devs, 2 months ago the average gas is 6Gwei * 6m for 1 contract. Now it is 60Gwei.

Solution:

useDApp setup

Problem: I run into opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ]

Solution:

  1. Downgrade your node to 16 or
  2. use NODE_OPTIONS=--openssl-legacy-provider npm run react-app:start.
  3. If the above is troublesome, put export NODE_OPTIONS=--openssl-legacy-provider in ~/.zshrc first then npm run react-app:start. If export... doesn't work, do unset NODE_OPTIONS first.

9 November 2022

Regex

Replace all HTML tags:replaceAll("\\<[^>]*>","")
Split by punctuation:.split("[\\p{Punct}\\s]+")

Top comments (0)