Friday, April 8, 2022

[SOLVED] Got this error while installing NODE JS

Issue

I am trying to install by this

sudo npm install

Got this error

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/mean/node_modules/node-sass/build'
gyp ERR! System Linux 4.8.0-53-generic
gyp ERR! command "/usr/bin/node" "/opt/mean/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /opt/mean/node_modules/node-sass
gyp ERR! node -v v9.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN [email protected] requires a peer of eslint@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-react@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /home/ranjit/.npm/_logs/2018-01-12T07_23_24_314Z-debug.lo

g

I have chnaged the permission also. But did not work for me.

Source - https://www.digitalocean.com/community/tutorials/how-to-install-a-mean-js-stack-on-an-ubuntu-14-04-server


Solution

Try to login as root user first with this command sudo -i.



Answered By - Nikola Andreev
Answer Checked By - Marie Seifert (WPSolving Admin)