Npm Err Please Try Running This Command Again as Root administrator

Npm Please attempt using this command again as root/ambassador

  • Home
  • Question
  • Npm Please try using this command again as root/administrator

I've been desperately trying to install modules using node.js but it always fails getting packages with npm.

I logged in as Administrator and used powershell/cmd with "run equally ambassador". I also had problems with the registry and so I used npm set up registry http://registry.npmjs.org/

I tried everything... it just drives me nuts.

Here are the errors:

npm ERR! Please endeavor running this control over again every bit root/Administrator.

              npm ERR! Organization Windows_NT 6.2.9200 npm ERR! command "C:\\Programme Files\\nodejs\\\\node.exe" "C:\\Plan Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "generator-knockout" npm ERR! cwd D:\Sergiu\Knockout Test npm ERR! node -v v0.x.26 npm ERR! npm -v 1.4.iii npm ERR! path D:\Sergiu\Knockout Test\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\block-stream\block-stream.js npm ERR! fstream_path D:\Sergiu\Knockout Examination\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\block-stream\block-stream.js npm ERR! fstream_type File npm ERR! fstream_class FileWriter npm ERR! code EPERM npm ERR! errno l npm ERR! stack Fault: EPERM, lstat 'D:\Sergiu\Knockout Exam\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\block-stream\block-stream.js' npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\author.js:284:26 npm ERR! fstream_stack Object.oncomplete (fs.js:107:xv) npm ERR! Error: EPERM, lstat 'D:\Sergiu\Knockout Test\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\fstream\LICENSE' npm ERR!  { [Error: EPERM, lstat 'D:\Sergiu\Knockout Test\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\fstream\LICENSE'] npm ERR!   errno: fifty, npm ERR!   code: 'EPERM', npm ERR!   path: 'D:\\Sergiu\\Knockout Test\\node_modules\\generator-knockout\\node_modules\\yeoman-generator\\node_modules\\tar\\node_modules\\fstream\\LICENSE', npm ERR!   fstream_type: 'File', npm ERR!   fstream_path: 'D:\\Sergiu\\Knockout Test\\node_modules\\generator-knockout\\node_modules\\yeoman-generator\\node_modules\\tar\\node_modules\\fstream\\LICENSE', npm ERR!   fstream_class: 'FileWriter', npm ERR!   fstream_stack: npm ERR!    [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\fstream\\lib\\writer.js:284:26', npm ERR!      'Object.oncomplete (fs.js:107:15)' ] } npm ERR! npm ERR! Please effort running this control again as root/Administrator.                          

This question is tagged with windows node.js npm

~ Asked on 2014-03-11 11:57:08

32 Answers


It turns out that y'all don't have to run the command again every bit Administrator, and doing so won't fix the trouble.

Attempt:

  1. npm enshroud clean first.

  2. If that doesn't fix things, take a await in %APPDATA%\npm-cache, or if you're using PowerShell, $env:APPDATA\npm-cache.

Afterward cleaning the cache, you may withal be left with remnants. Manually remove everything in that directory, and try again. This has always stock-still things for me.

As @Crazzymatt was mentioning, as of the [email protected] version and up, nosotros need to apply npm cache verify instead of npm cache make clean. Or else you will get an error as preceding.

npm ERR! As of [email protected], the npm cache self-heals from abuse issues and information extracted from the cache is guaranteed to be valid. If you desire to make certain everything is consequent, utilize 'npm cache verify' instead.

(Source: MSDN Web log mail service)

~ Answered on 2014-x-28 10:fifty:09


I solve it running equally ambassador cmd. Cleaning the cache npm cache clean -f And and then try to install the package again

~ Answered on 2016-05-27 10:53:28


You should run cmd.exe as administrator.

Follow the following steps:

  • Click Start, click All Programs, and then click Accessories.
  • Right-click Command prompt, and then click Run as administrator.

~ Answered on 2015-01-10 xix:40:26


Here is how I fixed this on my Windows (7) Dev. environment. I assume the following...

  • You lot are Running Command Prompt, Git Bash, Cmder or your favorite Last, as an Administrator by right clicking
  • Privileges Permissions have been granted for Read/Write (i.e chmod -777)

Okay, permit's become to information technology:

  1. Update any packages where a version check is returning a alarm ("npm WARN"..) for instance...

    npm update -g npm

    npm update -k graceful-fs

  2. Next we desire to strength a cache clean. This is flagged by an '--f' or '-f'..

    npm cache clean --f

  3. In Widows Explorer search for the following path

%APPDATA%\npm-enshroud

And Delete it'southward contents

  1. Start a fresh instance of your Terminal, remembering to 'Right-Click' and 'Run equally Administrator ', install the packages again.

Hope this helps someone!!

~ Answered on 2017-05-04 xix:18:55


I was already running the Node Command Window as Administrator. Equally mentioned by many above, the following command with --f (strength) solved my effect.

npm cache clean -f

Later on the Cache Clean, the install was flawless. Encounter the screenshot for reference

~ Answered on 2017-08-30 nineteen:25:26


~ Answered on 2017-10-04 18:20:11


If you're using TFS or whatever other source control for your project that sets your checked in files to readonly mode, then you lot gotta make sure parcel.json is checked out before running npm install. I've made this mistake plenty of times.

~ Answered on 2015-07-09 14:42:twenty


Here is how I fixed the trouble in Windows. I was trying to install the CLI for Angular.

  1. Turn off firewall and antivirus protections.

  2. Right click the nodejs binder (nether Program Files), select Backdrop (curlicue all the mode down), click the Security tab, and click all items in the Let column (for All Organisation Packages and any user or group that allows y'all to add the "allow" checkmark).

  3. Click the Windows icon. Type cmd. Right click the top upshot and select Run as Administrator. A command window results.

  4. Type npm cache clean. If in that location is an error, close log files or anything open and rerun.

  5. Type npm install -g @athwart/cli (Or whatsoever npm install command y'all are using)

  6. Check the installation by typing ng –version (Or any you need to verify your install)

Good luck! Notation: If you are however having problems, check the Path in Ecology Variables. (To admission: Command Panel ? System and Security ? System ? Advanced system settings ? Environment variables.) My path variable included the following: C:\Users\Michele\AppData\Roaming\npm

~ Answered on 2017-04-02 23:54:19


Try post-obit steps

1. Run this control on Terminal or CMD - npm enshroud clean

2. Go to this folder on windows %APPDATA%\npm-cache And delete folder which you lot want to install module (Ex:- laravel-elixir) or if you are using PowerShell, $env:APPDATA\npm-cache

3. Then Run your control EX:- npm install laravel-elixir

~ Answered on 2016-08-08 10:10:22


I had the same problem and I've fixed the error by cleaning the cache:

              npm cache clean -f                          

~ Answered on 2019-03-30 17:ten:34


I had the aforementioned problem, what I did to solve it was ran the cmd.exe as administrator even though my account was already fix as an administrator.

~ Answered on 2014-04-ten 17:33:21


This is the menses oftentimes happens in this case. You run a control with no admin rights, you get message npm ERR! Please effort running this command once more as root/Administrator.. So you open one more than CLI(cmd, powershell, bash or whatever) and don't close the previous CLI. It appears you take 2 prompts opened in the aforementioned directory. And until you shut CLI which runs with no admin rights you will be continuously getting npm ERR! Delight try running this control over again equally root/Administrator. So close CLI which runs with no admins rights before running a new one.

NOTE: a lot of IDE has embedded CLI(Visual Studio, VS Lawmaking etc) and then please close the example of IDE as well

~ Answered on 2018-04-23 15:12:47


npm cache verify

Try for newer versions of npm.

I'thousand using v 5.five.1 and information technology'due south working fine.

~ Answered on 2017-eleven-03 14:54:01


If you are doing this on mac type: sudo chown -R $USER /usr/local that will give you lot authoritative admission to your files

~ Answered on 2015-06-05 19:09:53


This worked for me, if your packet.json is not too big you tin do this:

  • Signout and then signin.
  • Delete node_modules.
  • npm install once more.

~ Answered on 2017-12-15 17:59:42


Deleting the global npm-cache and/or running my cmd line as admin did not work for me. Also, as of npm version 5.x.x, it supposedly recovers from cache abuse by itself.

This did work:

ane. Deleted the node_modules folder in my current project.

2. Deleted the package-lock.json in my electric current project

3. Installed the new package. In my case: npm install [electronic mail protected] --salvage

4. Ran npm install for my electric current project.

Everything now works. In full general, nuking node_modules and package-lock.json ordinarily fix these "no apparent reason" bugs for me.

EDIT

I just had the same trouble again. Simply I noticed that everything was installed correctly even though it threw the error after I had followed the steps outlined above. So I could just run ng serve (for Angular), and everything worked.

This certain is a weird fault...

~ Answered on 2017-09-x fourteen:20:29


As a hack,

Bank check if the binder path it is complaining exists or not. If not, endeavour creating them manually and rerun the installation, after clearing the cache

I had success with this, when running the installation from command prompt as an Administrator didn't work

~ Answered on 2017-09-11 xx:40:57


I messed with this problem 2 times and tried all suggestions here with mediocre success.

  • Offset fourth dimension I tried (and succeeded luckily) by:

    1. delete the node_modules binder in your projection

    2. npm clean cache -f

    3. check your %APPDATA%/npm-cache and delete everything if not empty

    4. beginning the terminal equally administrator (in my opinion, it isnt a problem of rights, but it wont hurt if y'all practice so)

    5. npm install and then npm update

    6. you will get errors, merely install every module that throws an mistake manually and step by step try to eliminate everything whats wrong

Even so, this method is quite frustrating and not working everytime. So endeavour this:

  • Second time I had no luck with the steps above, then I tried to completely reinstall npm and information technology failed. And then I idea there must something be incorrect with my node.js installation. My squad is running half dozen.x. and I had the vi.11. and tried information technology with the 6.10. with no luck.

    1. And then I completely wiped everything off my organisation. Deleted all node modules, checked every path where node or npm could be and cleaned my arrangement.

    2. Then I installed newest 8.1.iii

    3. Deleted my project and cloned it to a consummate dissimilar directory.

    4. Now I installed and updated everything with npm install npm update

    5. Then I compiled with just 2 modules missing and installed them manually

Tadaaaaa, its working now. And so all in all it was a problem with node.js. I recommend to everyone who runs into this problem: Try different node versions! And make clean Absolute everything.

~ Answered on 2017-07-06 xiv:02:38


As my last resort with this error I created a fresh windows 10 virtual car and installed the latest nodejs (v6). But there was a host of other "ERRs!" to piece of work through.

I had to run npm cache clean --forcefulness which ironically will give you lot a message that reads "I sure hope you know what yous are doing". That seems to have worked.

Information technology doesn't solve the issue on my main Dev machine. I'm canning nodejs every bit I found over the last few years that you spend more time on fixing it rather than on actual development. I had fewer issues with node on linux ubuntu 14.04 if that'due south any assistance.

~ Answered on 2017-08-26 19:05:49


$ npm cache clean
npm ERR! Equally of [email protected], the npm cache self-heals from abuse issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, apply 'npm cache verify' instead.

I tried running npm cache verify with admin rights and it worked after that.

~ Answered on 2017-ten-31 ten:l:09


What helped me on Windows 10 was just ticking off "Read Only" of projection node_modules.

~ Answered on 2017-04-15 15:03:xl


  1. Close the IDE
  2. Shut the node terminals running ng serve or npm starting time
  3. Go to your project folder/node_modules and see you if can find the package that you are trying to install
  4. If you find the package you are searching then delete package binder
  5. In case, this is your 1st npm install then skip step iv and delete everything inside the node_modules. If you lot don't find node_modules then create one folder in your projection.
  6. Open the terminal in admin mode and do npm install.

That should gear up the issue hopefully

~ Answered on 2017-12-21 09:43:12


FINALLY Got this working after four hours of installing, uninstalling, updating, apathetic blah.

The only thing that did information technology was to use an older version of node v8.nine.1 x64

This was a PC windows ten.

Promise this helps someone.

~ Answered on 2018-03-21 05:01:16


A solution that worked, is to close all PowerShell and cmd instances. Start PowerShell/cmd once more every bit administrator and things seem to work.

This tin can happen if yous're doing react-native and the node.js cmd is open in the background.

~ Answered on 2018-08-14 00:51:10


Also call back to terminate all other npm commands eastward.g. npm run dev-server.

~ Answered on 2018-07-24 09:23:47


For those doing this on a MAC. Merely put sudo in front of the command. Information technology will ask you for your password and then run fine. Cheers

~ Answered on 2020-05-25 08:14:02


On windows 10, npm enshroud clean --strength and npm cache verify did not work for me. Tried to delete enshroud folder and file with ambassador permission, did not work. The procedure-explorer tool helped me finding that Node.exe is holding on the cache file. I killed the procedure and tried to make clean, worked.

~ Answered on 2019-05-23 15:50:fifteen


I encountered this problem while executing the "npm publish" command.

So I checked the error log, and solved this by executing "npm config set registry http://registry.npmjs.org" control. The obvious reason for this trouble is that I gear up another registry.

So, if you are in the aforementioned situation equally mine, try setting the registry to official 1.

~ Answered on 2019-06-21 02:41:06


WHAT WORKED FOR ME

I ran Command Prompt equally Ambassador. This helped partially - equally I no longer got the error, "Please try using this command again as root/administrator". I was trying to install Cordova. To exercise it successfully, I besides had to exercise the following:

(1) "npm update node", plus...

(ii) I too added the " -g " in the >>npm install cordova<<. In other words, blazon this: >>npm install -g cordova<<

~~~ FOR WINDOWS 8.1 ~~~

"RUN Equally ADMINISTRATOR" COMMAND PROMPT

For windows viii.1, I don't have an ACCESSORIES group when I click Offset > ALL PROGRAMS. But I do accept that older -- but trusty and reliable -- START BUTTON and Kickoff MENU - thanks to the free Classic Start Menu app. So, with that installed....

ALTERNATIVE #1:

              1. Type "cmd" in the SEARCH BOX at the bottom of the START menu.   2. When cmd.exe shows up in the top of the search results, right click it and select RUN As Ambassador.                          

Alternative #2 If you already accept a Control Prompt window open and running - and you want to open up another 1 to Run Every bit Administrator:

              1. Locate the Control Prompt app icon in the Taskbar (ordinarily forth the bottom of you screen unless you have moved information technology a different dock/location). 2. Right click the app icon. 3. At present, right click "COMMAND PROMPT" and select RUN As ADMINISTRATOR.                          

Hope this helps someone.

~ Answered on 2017-07-24 nineteen:53:08


If you're in react native project, and Expo is running, and so close it.

Re-install the package, and everything should exist fine.

~ Answered on 2018-05-26 18:14:50


Like the other answers, make clean npm cache and make certain the enshroud folder is empty, and so run npm install several times. Each fourth dimension the error message comes for unlike packages, and the final time (later 10 attempts) it succeeds.

  1. Run npm make clean cache --force
  2. cd %APPDATA%\npm-cache (or cd $env:APPDATA\npm-cache for PowerShell)
  3. del * to delete everything in the folder
  4. Go back into the projection folder and run npm install several times until it succeeds. Notice that the mistake messages come up for different packages every time.

~ Answered on 2017-06-17 14:47:39


I don't know which steps worked for me. But these are my steps to get rid of this fault:

  1. Updated Node.js
  2. Ran npm cache clean command in Command prompt ( With some element of doubt for enshroud presence)
  3. Ran react-native init in command prompt as Administrator (on Windows Os), hoping works well with sudo react-native init on Mac Bone

~ Answered on 2016-07-30 16:08:53


moreaulithervithed.blogspot.com

Source: https://syntaxfix.com/question/10020/npm-please-try-using-this-command-again-as-root-administrator

0 Response to "Npm Err Please Try Running This Command Again as Root administrator"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel