I tried to install gatsby-cil on WLS2 with npm and failed.
here is the error message
root@LAPTOP-7EEFPLOM:~# npm install -g gatsby-cli
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v16.14.0/lib/node_modules/gatsby-cli/node_modules/lmdb
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! sh: 1: node-gyp-build: Permission denied
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-03-14T01_49_08_533Z-debug-0.log
I thought it was WSL that is to blame at first, then I tried to do the same thing on a cloud server and got the same result.
I also tried a solution found on the Internet:
npm config set user 0
npm config set unsafe-perm true
but still got the same error