Error: EACCES: permission denied, unlink '/usr/local/bin/npm - root

First and foremost I have looked into these previous post for answers: EACCES: permission denied, unlink
Error: EACCES: permission denied, unlink '/usr/local/bin/npx'
Error while building or running ngx-bootstrap tests
I do not see the answers I seek in any of these posts, or maybe I am not knowledgable enough to decipher how to use those answers to fix my issue. I am still learning so please, if you are answering my post make sure you explain, so that I may fully grasp what is being done and why. I would appreciate it very much.
In VS Code I was trying to work on a project but needed to update the npm version. See example:
After researching the f***(pardon my language) out of this, I did the following:
after reading this article: https://flaviocopes.com/npm-fix-missing-write-access-error/
I did what he suggested and then tried to do the npm update.
I then did the following, to find who owns the directory
After this I am pretty much at lost of what to do next, why do I have three 'drwxr-xr-x'? what does that exactly mean, that I have three npm packages? can I combine them all into one? or would it be better to delete all and start from scratch, but would I run into the same issue?
I also read this:
To minimize the chance of permissions errors, you can configure npm to
use a different directory. In this example, you will create and use a
hidden directory in your home directory.
Back up your computer. On the command line, in your home directory,
create a directory for global installations: mkdir ~/.npm-global
Configure npm to use the new directory path: npm config set prefix
'~/.npm-global' In your preferred text editor, open or create a
~/.profile file and add this line: export PATH=~/.npm-global/bin:$PATH
On the command line, update your system variables: source ~/.profile
To test your new configuration, install a package globally without
using sudo
but will that work if I have to [unlink '/usr/local/bin/npm'], according to the terminal. In all honestly, I prefer not reconfigure as I would need to back up everything, does anyone have a solution or suggestion as to what to do?
Thank you all in advance. And again I would like to reiterate that I am still learning, so please be kind and elaborate on your answer.

See if you have another path setup
like **
/usr/local/share/npm/bin
**
or so and just run install like this below.
**
sudo npm install npm#latest -g
**

Related

Installation packages no longer found after updating my Mac to 12.2.1

I'm using tcsh shell to access installation packages for my research. After a recent update, my login shell is no longer able to find where those installation files are located. I receive a prompt like this:
!! Attention: GEMC installation check /opt/jlab_software/2.5/Darwin_macosx12.2.1-clang13.0.0/gemc/2.9/gemc not found
Where GEMC is one of several installation files.
I see that it is looking in the directory Darwin_macosx12.2.1-clang13.0.0, which is not where the files are located, but rather they are located in Darwin_macosx12.1-clang13.0.0. I tried creating a symbolic link with the following command:
ln -s Darwin_macosx12.2.1-clang13.0.0 Darwin_macosx12.1-clang13.0.0
But I am still receiving the error informing me that the files are not found. I figured that I incorrectly used the symbolic link (and probably still am) so I pasted in the entire paths in the above command, and still no luck.
I am still kind of a newbie when it comes to Unix commands and navigation, so I apologize if I explained this poorly. That being said, I would really appreciate if someone could help me find a solution to this problem. Thank you in advance!

grpcui: command not found

I am new to grpcui. I've been trying to follow the installation. I did
go get github.com/fullstorydev/grpcui/...
go install github.com/fullstorydev/grpcui/cmd/grpcui
I also added grpcui path to my $PATH. Even tried to pull down the repo and make install. But I keep getting grpcui: command not found. Anyone could help ?
After installation, your grpcui should be in /home/user/go/bin. If so, try and add that folder to your $PATH, as I did (and it worked).
To further Adam's answer, a critical step in updating the PATH is restarting the terminal.
On OSX this needs to be done via exec bash -l. Simply exiting and opening the terminal does not work.
path gist
terminal SO question

How to install JSHint

I get this popup in VSCode: Failed to load jshint library. Please install jshint in your workspace folder using 'npm install jshint' or globally using 'npm install -g jshint' and the press Retry
Tried using Command Prompt in Win10
Can I get a literal step by step process Please.
(Please Note I am absolutely New to all of this, Currently Learning HTML/CSS & the above is popped up)
Thanks in Advance
QB
just follow the prompt given.
open Command Prompt in Win10.
and for all future work. do this.
npm install -g jshint
and
-g is for adding it globally.
For future reference - always try to copy and paste the error/prompt in Google first and you will be able to find answers yourself and will be able to find more and learn more stuff related to issues after seeing how many people get same thing in start and how they fixed it.
For future reference - BOOKMARK THIS - https://www.w3schools.com/whatis/whatis_npm.asp there's a lot for a beginner in simple words. hope this helped you.

Unable to run any Meteor Js command

What's the cause of this problem and how do I fix it?
Machine:~ username$ meteor create project
'/Users/username/.meteor' exists, but '/Users/username/.meteor/meteor' is not executable.
Remove it and try again.
Machine:~ username$
I’m unable to tell what the problem is, but you can likely fix it by moving the file and installing meteor again. To move the file:
$ mv ~/.meteor/meteor ~/meteor.bak
Then try to reinstall meteor.
[EDIT]
You can additionally try to chmod +x ~/.meteor/meteor but the meteor instructions recommend removing the file so I recommend you move it and rename just as a back up until you reinstall.

Grunt for Brackets Extension Not Working For me

When I use this plugin, Grunt for Brackets, it doesn't seem to work for me. I've looked and looked and looked through the files of the extension, and when I "grunt," my devtools spit out this log.
[node-log 10:01:49 AM] { '0': { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' } }
I'm not exactly sure what that means...
Here is a link to the extension.
The author has not updated anything in months, and there is an open issue ticket, however there hasn't been any responses.
If someone could help me decipher this log, I would greatly appreciate it.
Do you have Grunt installed on your computer already? If so, is it installed in the standard location? (e.g. did you intsall using npm -g grunt?)
ENOENT basically means "file not found," and since the error message also says spawn I'm guessing the problem is it's unable to find the Grunt binary to execute.
Update: Looks like a bug in how the current version of the extension was packaged. You should be able to fix it yourself this way:
Help > Show Extensions Folder in Brackets and find the brackets-grunt extension in the 'user' subfolder
Open a command prompt at that location
cd into the node folder inside the extension
Run npm install
I added a note to the bug, so hopefully the extension's author will fix it soon too.

Resources