Lease Try Running This Command Again as Root administrator
Npm Delight endeavour using this control over again every bit root/administrator
- Home
- Question
- Npm Please try using this command again as root/administrator
I've been desperately trying to install modules using node.js but information technology ever fails getting packages with npm.
I logged in as Administrator and used powershell/cmd with "run as administrator". I likewise had problems with the registry so I used npm fix registry http://registry.npmjs.org/
I tried everything... it just drives me nuts.
Here are the errors:
npm ERR! Delight attempt running this command again every bit root/Administrator.
npm ERR! Organisation Windows_NT 6.two.9200 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "generator-knockout" npm ERR! cwd D:\Sergiu\Knockout Test npm ERR! node -5 v0.10.26 npm ERR! npm -five 1.4.3 npm ERR! path D:\Sergiu\Knockout Test\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\cake-stream\block-stream.js npm ERR! fstream_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_type File npm ERR! fstream_class FileWriter npm ERR! code EPERM npm ERR! errno 50 npm ERR! stack Error: EPERM, lstat 'D:\Sergiu\Knockout Test\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\block-stream\cake-stream.js' npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26 npm ERR! fstream_stack Object.oncomplete (fs.js:107:xv) npm ERR! Fault: EPERM, lstat 'D:\Sergiu\Knockout Test\node_modules\generator-knockout\node_modules\yeoman-generator\node_modules\tar\node_modules\fstream\LICENSE' npm ERR! { [Fault: 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 Exam\\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\\author.js:284:26', npm ERR! 'Object.oncomplete (fs.js:107:15)' ] } npm ERR! npm ERR! Please try running this command once again as root/Administrator.
This question is tagged with windows
node.js
npm
~ Asked on 2014-03-11 eleven:57:08
32 Answers
It turns out that you lot don't have to run the command once again equally Administrator, and doing so won't set up the problem.
Effort:
-
npm cache clean
first. -
If that doesn't fix things, take a look in
%APPDATA%\npm-cache
, or if yous're using PowerShell,$env:APPDATA\npm-cache
.
Later on cleaning the cache, you lot may still be left with remnants. Manually remove everything in that directory, and try again. This has always fixed things for me.
Equally @Crazzymatt was mentioning, as of the [email protected] version and upward, we need to use npm enshroud verify
instead of npm cache clean
. Or else you will become an error as preceding.
npm ERR! As of [e-mail protected], the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If yous want to make certain everything is consequent, utilise 'npm cache verify' instead.
(Source: MSDN Web log post)
~ Answered on 2014-10-28 10:50:09
I solve it running as administrator cmd. Cleaning the cache npm enshroud clean -f
And then attempt to install the package once more
~ Answered on 2016-05-27 10:53:28
You should run cmd.exe as ambassador.
Follow the following steps:
- Click First, click All Programs, and and then click Accessories.
- Right-click Command prompt, and and so click Run every bit administrator.
~ Answered on 2015-01-ten nineteen:40:26
Here is how I stock-still this on my Windows (vii) Dev. environment. I assume the following...
- You are Running Command Prompt, Git Fustigate, Cmder or your favorite Terminal, equally an Administrator by correct clicking
- Privileges Permissions have been granted for Read/Write (i.e chmod -777)
Okay, permit's get to information technology:
-
Update whatever packages where a version check is returning a warning ("npm WARN"..) for case...
npm update -thousand npm
npm update -g graceful-fs
-
Next we want to force a cache make clean. This is flagged by an '--f' or '-f'..
npm cache clean --f
-
In Widows Explorer search for the following path
%APPDATA%\npm-enshroud
And Delete it'due south contents
- Outset a fresh instance of your Terminal, remembering to 'Right-Click' and 'Run every bit Administrator ', install the packages over again.
Hope this helps someone!!
~ Answered on 2017-05-04 19:eighteen:55
I was already running the Node Control Window as Administrator. Equally mentioned by many above, the following command with --f (force) solved my consequence.
npm cache clean -f
Later on the Cache Clean, the install was flawless. Come across the screenshot for reference
~ Answered on 2017-08-30 nineteen:25:26
~ Answered on 2017-10-04 18:20:11
If you lot're using TFS or any other source command for your project that sets your checked in files to readonly mode, then you lot gotta make sure package.json is checked out before running npm install. I've made this fault plenty of times.
~ Answered on 2015-07-09 14:42:20
Hither is how I fixed the trouble in Windows. I was trying to install the CLI for Angular.
-
Plow off firewall and antivirus protections.
-
Right click the nodejs binder (under Program Files), select Properties (scroll all the manner downwardly), click the Security tab, and click all items in the Allow cavalcade (for All Arrangement Packages and whatsoever user or group that allows you to add the "allow" checkmark).
-
Click the Windows icon. Type cmd. Right click the superlative outcome and select Run equally Administrator. A command window results.
-
Type npm cache clean. If there is an error, close log files or anything open and rerun.
-
Blazon npm install -g @angular/cli (Or whatsoever npm install command you are using)
-
Check the installation past typing ng –version (Or whatever you lot need to verify your install)
Good luck! Annotation: If you lot are however having problems, bank check the Path in Environmental Variables. (To admission: Command Panel ? Organization and Security ? System ? Avant-garde organisation settings ? Environment variables.) My path variable included the post-obit: C:\Users\Michele\AppData\Roaming\npm
~ Answered on 2017-04-02 23:54:19
Try following steps
i. Run this command on Last or CMD - npm cache make clean
2. Go to this binder on windows %APPDATA%\npm-cache
And delete folder which y'all want to install module (Ex:- laravel-elixir) or if you are using PowerShell, $env:APPDATA\npm-cache
3. And then Run your command EX:- npm install laravel-elixir
~ Answered on 2016-08-08 x:x:22
I had the same problem and I've stock-still the error by cleaning the cache:
npm cache clean -f
~ Answered on 2019-03-30 17:ten:34
I had the same problem, what I did to solve it was ran the cmd.exe as administrator even though my business relationship was already prepare every bit an ambassador.
~ Answered on 2014-04-10 17:33:21
This is the flow often happens in this case. You run a command with no admin rights, y'all get message npm ERR! Please try running this control again as root/Administrator.
. Then you lot open one more CLI(cmd, powershell, bash or whatever) and don't close the previous CLI. It appears you lot take 2 prompts opened in the same directory. And until you close CLI which runs with no admin rights y'all will exist continuously getting npm ERR! Please endeavor running this control again as root/Administrator.
Then close CLI which runs with no admins rights before running a new one.
Notation: a lot of IDE has embedded CLI(Visual Studio, VS Code etc) then delight close the instance of IDE besides
~ Answered on 2018-04-23 xv:12:47
npm cache verify
Effort for newer versions of npm.
I'thousand using v 5.5.1 and it's working fine.
~ Answered on 2017-11-03 14:54:01
If you are doing this on mac type: sudo chown -R $USER /usr/local that will give y'all administrative access to your files
~ Answered on 2015-06-05 xix:09:53
This worked for me, if your package.json
is non besides big you can do this:
- Signout then signin.
- Delete
node_modules
. -
npm install
once more.
~ Answered on 2017-12-xv 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 corruption past itself.
This did work:
1. Deleted the node_modules folder in my electric current project.
two. Deleted the parcel-lock.json in my current project
3. Installed the new package. In my case: npm install [email protected] --save
4. Ran npm install
for my current projection.
Everything now works. In general, nuking node_modules and parcel-lock.json commonly ready these "no apparent reason" bugs for me.
EDIT
I just had the same trouble once more. Simply I noticed that everything was installed correctly even though information technology threw the error after I had followed the steps outlined above. So I could just run ng serve
(for Angular), and everything worked.
This sure is a weird error...
~ Answered on 2017-09-10 14:20:29
Every bit a hack,
Cheque if the binder path information technology is complaining exists or not. If non, attempt creating them manually and rerun the installation, later immigration the cache
I had success with this, when running the installation from control prompt as an Ambassador didn't piece of work
~ Answered on 2017-09-11 20:xl:57
I messed with this problem 2 times and tried all suggestions here with mediocre success.
-
First time I tried (and succeeded luckily) past:
-
delete the node_modules folder in your project
-
npm clean cache -f
-
check your
%APPDATA%/npm-enshroud
and delete everything if not empty -
commencement the terminal as ambassador (in my opinion, it isnt a problem of rights, simply it wont hurt if you practise so)
-
npm install
and sonpm update
-
you volition get errors, just install every module that throws an fault manually and footstep by step try to eliminate everything whats wrong
-
However, this method is quite frustrating and not working everytime. Then try this:
-
Second fourth dimension I had no luck with the steps higher up, then I tried to completely reinstall npm and it failed. And so I thought there must something be wrong with my node.js installation. My team is running 6.x. and I had the 6.11. and tried it with the half-dozen.ten. with no luck.
-
Then I completely wiped everything off my arrangement. Deleted all node modules, checked every path where node or npm could exist and cleaned my organization.
-
And then I installed newest 8.one.3
-
Deleted my project and cloned it to a complete dissimilar directory.
-
Now I installed and updated everything with
npm install
npm update
-
Then I compiled with just 2 modules missing and installed them manually
-
Tadaaaaa, its working now. So all in all it was a problem with node.js. I recommend to anybody who runs into this problem: Try different node versions! And 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 machine and installed the latest nodejs (v6). But at that place was a host of other "ERRs!" to piece of work through.
I had to run npm cache make clean --force
which ironically will give you a message that reads "I certain hope you know what y'all are doing". That seems to have worked.
It doesn't solve the event on my principal Dev motorcar. I'thousand canning nodejs every bit I found over the terminal few years that yous spend more time on fixing it rather than on bodily development. I had fewer bug with node on linux ubuntu 14.04 if that's 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 corruption problems and data extracted from the cache is guaranteed to exist valid. If you lot desire to make sure everything is consequent, apply 'npm cache verify' instead.
I tried running npm cache verify
with admin rights and it worked after that.
~ Answered on 2017-10-31 10:fifty:09
What helped me on Windows 10 was just ticking off "Read Only" of project node_modules
.
~ Answered on 2017-04-fifteen xv:03:40
- Close the IDE
- Close the node terminals running ng serve or npm start
- Go to your project folder/node_modules and see yous if can find the parcel that you lot are trying to install
- If you find the package you are searching then delete package folder
- In case, this is your 1st npm install then skip footstep 4 and delete everything inside the node_modules. If yous don't discover node_modules so create one folder in your project.
- Open up the terminal in admin way and do npm install.
That should fix the issue hopefully
~ Answered on 2017-12-21 09:43:12
FINALLY Got this working after 4 hours of installing, uninstalling, updating, blah blah.
The only matter that did information technology was to apply an older version of node v8.ix.1 x64
This was a PC windows ten.
Hope this helps someone.
~ Answered on 2018-03-21 05:01:16
A solution that worked, is to close all PowerShell and cmd instances. Beginning PowerShell/cmd again as administrator and things seem to work.
This can happen if y'all're doing react-native and the node.js cmd is open in the background.
~ Answered on 2018-08-14 00:51:10
Also retrieve to end all other npm commands east.g. npm run dev-server
.
~ Answered on 2018-07-24 09:23:47
For those doing this on a MAC. But put sudo in front of the control. It volition ask you for your password and so run fine. Cheers
~ Answered on 2020-05-25 08:14:02
On windows 10, npm cache clean --force
and npm enshroud verify
did not work for me. Tried to delete cache binder and file with ambassador permission, did not work. The process-explorer tool helped me finding that Node.exe
is holding on the cache file. I killed the process and tried to clean, worked.
~ Answered on 2019-05-23 15:fifty:15
I encountered this problem while executing the "npm publish" command.
And so I checked the mistake log, and solved this by executing "npm config set registry http://registry.npmjs.org" command. The obvious reason for this problem is that I fix up another registry.
So, if yous are in the same situation as mine, try setting the registry to official one.
~ Answered on 2019-06-21 02:41:06
WHAT WORKED FOR ME
I ran Control Prompt as Administrator. This helped partially - as I no longer got the error, "Please effort using this command once again as root/administrator". I was trying to install Cordova. To do it successfully, I also had to practice the following:
(1) "npm update node", plus...
(2) I also added the " -g " in the >>npm install cordova<<. In other words, type this: >>npm install -g cordova<<
~~~ FOR WINDOWS 8.1 ~~~
"RUN AS Ambassador" COMMAND PROMPT
For windows 8.1, I don't have an ACCESSORIES group when I click First > ALL PROGRAMS. But I do have that older -- only trusty and reliable -- Offset Push button and START Carte du jour - thanks to the costless Classic Starting time Bill of fare app. So, with that installed....
ALTERNATIVE #one:
ane. Type "cmd" in the SEARCH BOX at the bottom of the START menu. ii. When cmd.exe shows up in the top of the search results, right click it and select RUN AS Ambassador.
ALTERNATIVE #two If you already accept a Command Prompt window open and running - and you want to open another one to Run Every bit Administrator:
1. Locate the Command Prompt app icon in the Taskbar (ordinarily along the bottom of you lot screen unless yous have moved it a dissimilar dock/location). ii. Right click the app icon. three. At present, correct click "COMMAND PROMPT" and select RUN As ADMINISTRATOR.
Hope this helps someone.
~ Answered on 2017-07-24 xix:53:08
If y'all're in react native project, and Expo is running, then close it.
Re-install the packet, and everything should be fine.
~ Answered on 2018-05-26 xviii:xiv:50
Like the other answers, clean npm cache and make sure the cache folder is empty, then run npm install several times. Each time the error message comes for different packages, and the final time (after 10 attempts) it succeeds.
- Run
npm clean cache --strength
-
cd %APPDATA%\npm-cache
(orcd $env:APPDATA\npm-cache
for PowerShell) -
del *
to delete everything in the folder - Become back into the project folder and run
npm install
several times until information technology succeeds. Find that the error letters come for different packages every fourth dimension.
~ Answered on 2017-06-17 fourteen:47:39
I don't know which steps worked for me. But these are my steps to get rid of this fault:
- Updated Node.js
- Ran npm cache make clean command in Command prompt ( With some chemical element of doubt for cache presence)
- Ran react-native init in command prompt as Administrator (on Windows Bone), hoping works well with sudo react-native init on Mac Os
~ Answered on 2016-07-30 16:08:53
steigerwaldtheassion.blogspot.com
Source: https://syntaxfix.com/question/10020/npm-please-try-using-this-command-again-as-root-administrator
0 Response to "Lease Try Running This Command Again as Root administrator"
ارسال یک نظر