npm error: stack Error: EACCES: permission denied

Error

gyp verb remove removing development files for version: 13.12.0
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/var/www/html/seodaily/node_modules/node-sass/.node-gyp'
gyp ERR! System Linux 3.10.0-957.12.2.el7.x86_64
gyp ERR! command "/usr/bin/node" "/var/www/html/seodaily/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/html/seodaily/node_modules/node-sass
gyp ERR! node -v v13.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN ajv-keywords@3.4.1 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-04-09T07_05_21_969Z-debug.log

Solutions:

try the following command

sudo npm i --unsafe-perm
if it doesn't work try the following

sudo rm -rf ~/.node-gyp
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo npm i --unsafe-perm
Rajesh Kumar
Follow me