EPERM -4048, operation not permitted, unlink - javascript

Whenever I try to install anything with npm install, I get the following error (usually referencing a different path). I've tried npm cache clean but that gets a similar error. I tried restarting the PC and checked for processes that may be using npm. Followed several other answers and none of the ones I've tried have been successful.
The attached screenshot was taken just after uninstalling node, restarting my computer, removing everything about npm from AppData and Program Files etc. and then creating a brand new project to test in. The project and the directory were created in command line.
Any help would be truly appreciated. Thanks!
SCREENSHOT

You are trying to install the npm using the command
npm install -g cordova ionic
But it is supposed to be like
npm install ionic cordova -g
or
npm install -g ionic cordova
For more info check the below link
Error: EPERM: operation not permitted

Related

Error: You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1)

As the title says, I cannot run create-react-app.
You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
Doing this does not change the error. npm uninstall -g create-react-app
I entered this command to try it out and got a message that the tar was out of date.
npm install -g create-react-app
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code EEXIST
npm ERR! path /opt/homebrew/bin/create-react-app
npm ERR! EEXIST: file already exists
npm ERR! File exists: /opt/homebrew/bin/create-react-app
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
https://www.npmjs.com/package/tar
I ran the command with this reference.
However, the tar was not updated.
I have already tried all the published solutions, but they don't work. Can someone please help me? Please.
I tried clearing the cache but could not solve the problem.
npx clear-npx-cache
Need to install the following packages:
clear-npx-cache
Ok to proceed? (y) y
I was able to successfully run the following command by specifying the version each time, but it is a hassle and I want to be able to run it normally.
npx create-react-app#latest my-app
The "fish" shell I am currently using is node v18.0.0, so I downgraded to v16.15.0 and it works fine.
fisher install jorgebucaran/nvm.fish
nvm install v16
I had forgotten to lower the node version in fish because it had been working fine with zsh.

React Installation problem npx-create-react-app not working properly

This is the error that Im facing every-time i do npx create-react-app app-name.
At first It was all good everything was working perfectly but all of a sudden it's been a few days since Im facing this error and i cant seem to solve it.
hassan_xiddiqui#Kratos:~/React$ npx create-react-app starter_1
Need to install the following packages:
create-react-app
Ok to proceed? (y) y
Creating a new React app in /home/hassan_xiddiqui/React/starter_1.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/eslint-plugin-jsx-a11y: aborted
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/hassan_xiddiqui/.npm/_logs/2021-04-03T12_14_14_243Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting starter_1/ from /home/hassan_xiddiqui/React
Done.
The error is very clear in the message you're receiving:
This is a problem related to network connectivity.
In most cases you are behind a proxy or have bad network settings.
If you are behind a proxy, please make sure that the
'proxy' config is set properly. See: 'npm help config'
If you're using a VPS, disable it. Try checking your DNS settings, maybe change them to Google's.
Also, try to install anything from NPM to confirm this is an issue with your connection. npm install -g create-react-app. If this (or any other package) succeeds, it may be other issue.
Consider as well it could be an issue with npx on your machine. Try installing it using create-react-app directly instead by first installing it globally (like I showed above)
It's more of an network error you can check the config or try to flush your dns or something. Maybe try some other network if possible
Try to install npm again using: npm install
Also check what node version you're using: node --v
Then, run the command again: npx create-react-app app_name

Parcel.js. Error EPERM: operation not permitted, rename Cache

I'm using Parcel.js. When I'm trying to run Parcel and build my project via yarn parcel ./src/index.html
the EPERM error happens regarding parcel cache.
The error
Error: EPERM: operation not permitted, rename
'E:webproject-landing.parcel-cache65ca36a4b4620013e0950eda4009b3b2.blob.22060.1.6'
-> 'E:webproject-landing.parcel-cache65ca36a4b4620013e0950eda4009b3b2.blob'
OS: Windows 10
Execution ENV: Bash terminal/VSCode terminal
Could someone, please, give to me some advice?
Thanks for any help.
P.S. Also, I don't understand why the Path of the project, etc. is so strange, without any separators. Is this the Parcel specific?
I just solved it, I uninstall parcel, npm uninstall pacel, then installed it again, npm install parcel-bundler --save-dev
Answer
Ctrl-C or cancel the server you might have running and restart the dev. server and see if it fixes itself. It did for me.
Not sure if this is still an issue or if anyone else finds themselves here, but Parcel 2 is currently being developed and known bugs are at the github repo and there's a docs/blog for the project both linked below! It has been helping me a bunch!
https://v2.parceljs.org/
https://github.com/parcel-bundler/parcel
npm cache clean --force
npm install -g npm#latest --force
This works for me!

npm wont start a react app, requires a dependency: "webpack-dev-server": "3.1.14"

I am trying to create a new react-app and start it, I have created react apps before with no errors but this time when i npm start i get this error
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix
locally.
The react-scripts package provided by Create React App requires a
dependency:
"webpack-dev-server": "3.1.14"
Don't try to install it manually: your package manager does it
automatically.
However, a different version of webpack-dev-server was detected higher up
in the tree:
C:\Users\ashraf\node_modules\webpack-dev-server (version: 3.1.9)
Manually installing incompatible versions is known to cause hard-to-debug
issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to
an .env file in your project.
That will permanently disable this message but you might encounter other
issues.
To fix the dependency tree, try following the steps below in the exact
order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your
project folder.
2. Delete node_modules in your project folder.
3. Remove "webpack-dev-server" from dependencies and/or devDependencies in
the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the
above steps with it instead.
This may help because npm has known issues with package hoisting which may
get resolved in future versions.
6. Check if C:\Users\ashraf\node_modules\webpack-dev-server is outside
your project directory.
For example, you might have accidentally installed something in your home
folder.
7. Try running npm ls webpack-dev-server in your project folder.
This will tell you which other package (apart from the expected react-
scripts) installed webpack-dev-server.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in
your project.
That would permanently disable this preflight check in case you want to
proceed anyway.
P.S. We know this message is long but please read the steps above :-) We
hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! learnreact#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the learnreact#0.1.0 start 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! C:\Users\ashraf\AppData\Roaming\npm-cache\_logs\2019-02-
04T20_36_39_924Z-debug.log
PS C:\Users\ashraf\Desktop\Files\LearnReact\learnreact>
i have tried all the steps in detail in the error log but its still not working, any thoughts on what is causing this error? Thanks in advance
It seems like you want to depend on webpack-dev-server inside your local project.
Perhaps you need to run npm install in your project, instead of your ~ home directory?
from your output, notice these lines.
However, a different version of webpack-dev-server was detected higher up
in the tree:
C:\Users\ashraf\node_modules\webpack-dev-server (version: 3.1.9)
...
6. Check if C:\Users\ashraf\node_modules\webpack-dev-server is outside
your project directory.
For example, you might have accidentally installed something in your home
folder.
so I would
cd ./my-project
npm i
Did you install webpack-dev-server on its own? It seems it has been installed either by you or by another project install. Webpack is for your local development environment so the other install is close enough to your project to interfere with the copy that react is trying to install in your project folder. Steps 1-4 in your error message should resolve your issue. If you have done that and its still not working, did you get different error messages with your next attempt to install your react package?
I have faced the same issue and this method worked for me.
Do follow the steps:
Start terminal from the desktop and write this command:
npm uninstall webpack-dev-server
This will uninstall webpack-dev-server package globally from you node modules.
Go back to you the terminal of your project and install webpack-dev-server package:
npm install webpack-dev-server#version
Note: The version part (above) should equal the versions asked for in the error message.
npm install webpack-dev-server
Now start npm:
npm start
This error mostly occurs when you have created your project using the
npx create-react-app command instead of the npm create-react-app command.

Failed to create app with create-react-app in Linux 16.04

I am trying to create new app with create-react-app.
Below is the error.
Please help. Thanks in advance
➜ REACT create-react-app my-app
Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /media/budi/Tjung/#TJUNG/REACT/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.
error image at CLI
Looks like network problem to me. You could be behind a proxy. If that is the case, configure your proxy in npm like this
npm config set proxy http://proxy_host:port
For https
npm config set https-proxy http://proxy.company.com:8080
Note: The https-proxy doesn't have https as the protocol, but http.
Optionally you can also try,
npm config set strict-ssl false
Checkout this SO answer
check if npm exists on your system.
try the commands in this order.
1. npm install --save create-react-app
2. create-react-app projectname
The name of the project must be in lowercase
Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:
npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "my-app":
create-react-native-app my-app
cd my-app
npm start
I have solve this problem.. it is about internet speed connection.
.
When I met this problem, I have spent one day to find out the solution. I read so many article about ETIMEDOUT. I had uninstall and re-install npm and yarn. Still doesn't solve my problem.
.
Until then I found the spot that has high speed internet connection. Fortunately I can create new app with create-react-app.
I think there are problem with your configurations of npm package.
Maybe somewhere, you set up some proxy configuration to npm variables.
You can reset configs running this script in terminal
sudo sh -c 'echo "" > $(npm config get globalconfig)'
and wait until process will end and run
exit
Open another terminal window and try

Categories

Resources