I have a react-app on aws ec2 instance. I am having trouble installing the npm modules.
Getting this error:
EACCES: permission denied, mkdir '/home/react-app/node_modules/node-sass/vendor'
I have tried this solutions but didn't worked for me.
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/build'
EACCES: permission denied, mkdir '/node_modules/node-sass/build' while running npm install on ubuntu
npm install: Error: EACCES: permission denied, mkdir
Update
sudo npm install --allow-root --unsafe-perm
I tried this and it worked but, when I am going to build the app by
sudo npm run build
which will run this command,
node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ && react-scripts build
It got stuck/hanged on this line
Creating an optimized production build...
What should I do?