error An unexpected error occurred: "EACCES: permission denied - reactjs

I am getting an error while running npm install for a react application:
An unexpected error occurred: "EACCES: permission denied, unlink
'/home/ats/react-app/myapp/node_modules/#babel/helper-module-imports/LICENSE'".
Can someone help me sort this error out?

I had the same problem and I solved it like this:
Remove node_modules folder of your project manually.
Then yarn install or npm install.

Try changing the folder permissions to have the correct ones. If you consider there is no drawback to have the folder with full permissions this command should solve your problem:
sudo chmod -R 777 folderName

Execute as sudo if you are using Linux.

Related

Why I am getting this error - Error: EPERM: operation not permitted, mkdir 'C:\Users\Aniket' command not found: create-react-app

I have installing react app using this command
$ npx create-react-app my-app
Then I got Error like this:
Error: EPERM: operation not permitted, mkdir 'C:\Users\Aniket'
command not found: create-react-app
I have seen some online resources they are saying I have to remove space from my Windows Username, isn't there any other way of make this work?
Make sure you've node>=8.10 and npm>=5.6 already installed
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Edit: Above solution might work but it's not recommended way of solving this issue. Please refer https://create-react-app.dev/docs/getting-started
I referred the solution given at bottom and some other posts to use below command:
npm config set cache "C:\Users\mycomputer~1name\AppData\Roaming\npm-cache" --global
The easiest way for me is:
mkdir C:\cache
npm config set cache "C:\\cache"
And then run the command again.
Go to c:/users open command prompt and run dir /x check shorter name you found with dir/x as shown in image and run npm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
In my case it's CYBERC~1.
this works fine in my case.

The command create-react-app doesn't run, it creates an error

$ npx create-react-app awesomeApp
Error: EPERM: operation not permitted, mkdir 'C:\Users\'
command not found: create-react-app
This is a bug within npm if you have your username as "FirstName LastName"
A quick fix for this is -
If your UserName is - Anand Chavan all you need to use at
is ANANDC~1. i.e FirstName+First_Letter_of_your
LastName+~1 (All in capital)
npm config set cache "C:\Users\<UserNameWorkAround>\AppData\Roaming\npm-cache" --global
Example config for - Anand Chavan as username.
npm config set cache "C:\Users\ANANDC~1\AppData\Roaming\npm-cache" --global
I faced the same issue as well in Windows. And I solved it as below:
It may be due to your username having space in between your username. If so, kindly try this in your command prompt if you're using Windows:
npm config set cache "C:\Users\Your Name\AppData\Roaming\npm-cache" --global
Thereafter, try again: npx create-react-app awesome
I encountered EPERM errors while trying to clean install create-react-app and running an older version of it.
Excluding the node_modules folder from Windows' Virus & Threat Protection (answer found here) and then running my terminal as an administrator fixed it for me.

how do I solve 'erpnext' permission denial error?

when I run this command 'bench init erpnext && cd erpnext' on terminal I get this error: [Errno 13] Permission denied: 'erpnext'. So I tried this 'sudo bench init erpnext && cd erpnext' but got the message: You should not run this command as root. I am using this command so I can install ERPnext on my ubuntu.
Please advise.
The issue is raising because some of the files might be owned by some other user instead of frappe.. I think this might solve this issue chown -R frappe:frappe *

How to solve react startup error "cannot find module 'which'"?

Hitting npm start in cmd in my project directory is giving the above error.
I tried npm install -g which but that did not work.
Screenshot of cmd
Screenshot of the complete error log
Note:Please make a backup before applying these commmands.
These commands can help:
1)npm cache clean --force
2)remove/delete your node modules folder
3)npm install
4)npm start

"git add ." error fatal permission denied

Trying to upload some files to a repo. It worked for the last repo that I did, but now for some reason it's not working. Please help! :) Thanks :)
$ git add .
error: open("AppData/Local/Google/Chrome/User Data/Default/Application Cache/Cache/data_0"): Permission denied
error: unable to index file AppData/Local/Google/Chrome/User Data/Default/Application Cache/Cache/data_0
fatal: adding files failed
You are probably out of a git repo: try to cd into you repo.
If you are really in the correct directory, you must change the chmod of your folder.

Resources