Error: EPERM: operation not permitted, mkdir 'C:\Users\xxxxxxx' - npm-install

When i run "npm install && npm run dev"
i am getting this error
Error: EPERM: operation not permitted, mkdir 'C:\Users\xxxxxxx'
So what can i do to solve

I got this error after I've changed my computer user name. I didn't had a good idea to deal with the problem, but uninstalling nodejs and npm completely and deleting their environment variables. Then I reinstalled nodejs and the error was gone.

Related

Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\pagefile.sys'

I keep running into problem when I tried to run my Vue app today using the npm run serve command. I've done this countless time with the same repository but it gave this error when I started it just now.
This dependency was not found:
* node:console in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/News.vue?vue&type=script&lang=js&
To install it, you can run: npm install --save node:console
Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\pagefile.sys'
What I have tried to fix the problem:
Updates all the packages using npm install
Deleted the node_modules folder and reinstalled the entire dependency
Reload the git repository to the point where it still worked previously
Installed node:console using the command npm install --save node:console which returns the following error instead:
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "node:": node:console
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-06-03T16_45_28_752Z-debug.log
Obviously, none of the fixes had work.
Nevermind my error. It seems in my careless mistake I've appended import {timeEnd} from 'node:console' to the News.vue file just prior to creating a commit
execute command as admin
powercfg -h off

Uncaught Error Error: EPERM: operation not permitted, rename ~~~

Q. I got this problem in my expo project. How can i solve this problem?
Uncaught Error Error: EPERM: operation not permitted, rename 'C:\Users\예원.expo\state.json.1218894428' -> 'C:\Users\예원.expo\state.json'
npm ERR! code 1
npm ERR! path C:\KeywordAlarm
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c expo start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\예원\AppData\Local\npm-cache_logs\2021-02-09T13_39_43_115Z-debug.log
in my case, npm cache verify helped to solve this problem (win10, vs code)
Stop the project and try running npm cache clean. If that doesn't work, try npm cache clean --force.
Navigate to the mentioned directory (C:\Users[username].expo).
find state.json. duplicate it (state Copy.json) and remove the previous version. make sure the file name is state.json and voila.
try running npx expo login again.

EPERM: operation not permitted

I was trying to create a react-native app, and ran npx react-native init but an error message Error: EPERM: operation not permitted.
Error: EPERM: operation not permitted, mkdir 'C:\Users\ABIODUN'
command not found: react-native```
Try to close and open you terminal, and startclearing npm cache then,
You should use npx react-native init ProjectName to create a new project.

Unhandled rejection Error: EISDIR: illegal operation on a directory

I'm getting this error on my Mac when I try to install react-devtools
Hakk-MBP:HelloWorld hakkikonu$ sudo npm install -g react-devtools
Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/hakkikonu/.npm/_cacache/index-v5/ad/f6'
Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/hakkikonu/.npm/_cacache/index-v5/da/f2'
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hakkikonu/.npm/_logs/2019-02-05T14_33_58_146Z-debug.log
npm version is: 6.7.0
What is the reason?
[edit]
I believe this link is the correct solution.
Reinstall npm with a node version manager (recommended)
or
Manually change npm’s default directory
[original answer]
WARNING: this compromises security! It makes it possible for malicious code running without root access to write code into these directories, where it may end up running as root.
From here, don't run as sudo on Mac:
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib
sudo chown -R $(whoami) /usr/local/bin
Then try your command again without sudo. e.g. (react-devtools in your case)
npm install -g npm#latest
This solved the provblem for me after upgrading to npm v6.7.0

When i run 'npm install' command on my mac machine, am getting up a below error

When i run 'npm install' command on my mac machine, am getting up a below error. help me to solve this:
npm ERR! Unexpected end of JSON input while parsing near '...^1.7.0","sinon":"^4.0'
npm install