umang
umang

Reputation: 31

I am trying to install axios but such error occured

Command: npm install --save axios

I am unable to install axios. I am using reactnative in windows and want to make a HTTP request

Error

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.3 (node_modules\sane\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of eslint@^3.17.0 || ^4.0.0 but none was installed.
npm ERR! path D:\reactnative\albums\node_modules\.staging\axios-29ec864b
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'D:\reactnative\albums\node_modules\.staging\axios-29ec864b' -> 'D:\reactnative\albums\node_modules\axios'
npm ERR!  { [Error: EPERM: operation not permitted, rename 'D:\reactnative\albums\node_modules\.staging\axios-29ec864b' -> 'D:\reactnative\albums\node_modules\axios']
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path:
npm ERR!    'D:\\reactnative\\albums\\node_modules\\.staging\\axios-29ec864b',
npm ERR!   dest: 'D:\\reactnative\\albums\\node_modules\\axios',
npm ERR!   parent: 'albums' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

Upvotes: 2

Views: 18424

Answers (7)

mihaiB
mihaiB

Reputation: 1

in windows try to open the terminal as administrator then go in your app in node_modules folder and run: npm install axios --force

Upvotes: 0

Ragab Mohamad
Ragab Mohamad

Reputation: 708

Install Axios React js

  1. Go to Folder holds All Packages (npm) As src , public , node-modules

enter image description here

  1. Right Click and Select Open in Integrated Terminal
  2. Write in Terminal npm install axios

enter image description here

  1. Package.json

enter image description here

Upvotes: 0

RajK
RajK

Reputation: 39

I was trying to install axiuos and ran into this error after trying the solution here by Mchoeti

npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/axious - Not found npm ERR! 404 npm ERR! 404 'axious@*' is not in this registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/kusumarajesh/.npm/_logs/2022-02-09T04_04_50_334Z-debug.log

Upvotes: -1

Mchoeti
Mchoeti

Reputation: 536

I had the same issue. But it was easy to solve. I believe you have first created your project with npm init. This created a file package.json. Please verify if this file is open somewhere. In my case i closed the package.json and did a

npm install --save axios

again. Do not forget to commit the created package-lock.json Let me know if this helps Cheer Mchoeti

Upvotes: 1

Raj Shukla
Raj Shukla

Reputation: 1

I was also facing same problem Just go to your package-lock.json and there is fsevents,simply you can remove "optional": true from there and then reinstall axios. It will work fine!

"fsevents": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",

"dev": true,

"optional": true// remove this line },

Upvotes: -1

Yauhen Hloba
Yauhen Hloba

Reputation: 86

Try to reinstall axios by this commands:

  1. npm uninstall axios
  2. npm i axios

Upvotes: 2

Daniel Sameh
Daniel Sameh

Reputation: 1

Run command as administrator 1-if it still doesn't work then uninstall axios package by type "npm uninstall axios" 2- then close the node.js terminal 3- open command as administrator then go to the path then reinstall it "npm install axios" 4- then run the server again "react-native run-android" it should works fine.

Upvotes: 0

Related Questions