npkill - tool to remove node_modules
17 Aug 2022There is a fast way to remove node_modules folder, which can help us save mamory wonderfully.
- Run
npx npkill
in terminal - Select folder you want to delete and press SPACE key ! How simple is it ?
There is a fast way to remove node_modules folder, which can help us save mamory wonderfully.
npx npkill
in terminalI encounter error like picture when click button which used to connect wallet extension in AWS ubuntu environment :
This error appears if open web by using http not https. Establish SSL connection and become https, problem solved !
Run slither command then encounter error like :
Error: Source "@openzeppelin/contracts/access/Ownable.sol" not found: File not found. Searched the following locations: "".
Solution : add some flag behind original command ex.
slither contracts/YOUR_CONTRACT.sol --solc-remaps @openzeppelin/=$(pwd)/node_modules/@openzeppelin/
Error: Hydration failed because the initial UI does not match what was rendered on the server.
I encounter this problem after modify my folder location, and I solve this by cleaning the browser cache & to delete .next folder .
For example, this is my regular expression :
^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$
It used to check if string is in YYYY-MM-DD form.
I used code as below at first, and found that regexp.test
always return false, even thouth it should return true.
const regexp = new RegExp('^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$')
console.log(regexp.test(date))
The solution is :
const regexp = new RegExp(/^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$/)
return(regexp.test(date))
To replace single quotations(‘) to slash(/) ! Check this website to get more information.