EACCES: permission denied, open '/Users/stefma/.config/truffle/config.json' after installing Truffle - npm-install

I tried literally all there is so far and I still can't run truffle macOS 11.6.
that's what I tried after of course first installing it with the command npm install -g truffle:
Downloading command line tools for Xcode and then installing with
sudo npm install -g truffle
sudo npm install --unsafe-perm=true --allow-root truffle
sudo chown myUsername:myUsername -R ~/.config
installing npm and node with nvm all over.
I'd be really grateful for any help

This should work kindly check [YourMacOSUserName] in fir place you MacOSUserName in it and please must rate my effort will be here for any further query.
sudo rm -rf /Users/[YourMacOSUserName]/Library/Preferences/netlify/
npm install -g netlify-cli
sudo ntl login

Related

Why I can't get NPM upgraded?

Here is how I install NPM on a Linux Mint 19.
sudo apt install nodejs
sudo apt install npm
The NPM version I get is 3.5.2, which is not the current version. To upgrade, I try the following commands.
sudo npm install latest-version
which has a few warning messages such as "not such file or directory, open '/home/me/package.json'"
and
sudo mpn install npm#latest -g
which runs without any warning or error messages.
The command
npm -v
still yields 3.5.2.
What is missing?
Also, the reason of using sudo in those upgrade commands is to work around some access permission.
try running:
which npm
and
sudo which npm
I suspect by running sudo apt-get ... you installed npm for your root user as opposed to your current user.
Try this command: npm install -g npm#latest or npm install -g npm#next
You can update NPM with: npm install -g npm.
See this Q&A for more variations that might occur/needed.

Error installing package node-sass

I always have same problem when installing node-sass
sudo npm install -g node-sass
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/max/Sites/xxxxxxx/node_modules/node-sass/build'
I have update my node and npm version but the same nothing to do, it seems something with permission.... any idea?
It seems like it is due to a problem with installing node-sass which is one of the dependencies.
It is due to the use of sudo while trying to install packages.
Read this https://docs.npmjs.com/getting-started/fixing-npm-permissions to see how to fix your permissions.
It looks like you're running into permission issues. If you are installing npm-packages then it might possible that you are getting an EACCES error when trying to install a package globally. This means you do not have permission to write to the directories npm uses to store global packages and commands.
You can change the directory permissions by running commands: sudo chmod u+x -R 775 ~/.npm and sudo chown $USER -R ~/.npm or you can just run any npm command with sudo, that should get resolve your issue.
If you are installing an npm-package locally, then you should be in your local project directory and can try running sudo npm install <pkg-name> command to install required package. the purpose of using sudo is that it will change your owner permissions so you can make your current user authorized to run npm commands.
I'd recommend you to take a look at https://docs.npmjs.com/getting-started/fixing-npm-permissions
If you run sudo npm install -g node-sass --unsafe-perm should fix your issue.

npm 3.5.3 not working at all after upgrade

After I upgraded npm to 3.5.3 with
sudo npm install npm -g
on my Linux Mint 17.2 it doesn't work anymore. All the commands return to prompt without any message.
Tried:
sudo npm install -g yo
npm version
According to this and this I had to
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
hash -r #using bash
node --version # v0.10.25
!! WORK FOR ME !!
sudo rm -rf /usr/local/lib/node_modules
At this stage you will see that npm will not work, but sudo npm is working!
Now you can upgrade normally the npm:
sudo npm install -g npm

How to remove ripple emulator using npm

Have problem with uninstaling ripple emulator at Debian Jessie.
Was instaled by command
sudo npm install -g ripple-emulator
But when I try to uninstall using command
sudo npm rm ripple-emulator
It gives warning
npm WARN uninstall not installed in /home/user/node_modules: "ripple-emulator"
I have change location to /usr/share/npm/node_modules/ but there no folder with ripple emulator
If installed with the -g flag you need to pass that in when uninstalling as well. So the following should work:
sudo npm rm -g ripple-emulator

Typescript npm install not working

When I run sudo npm install -g typescript the only thing that gets installed is test3. This is what I get:
$ sudo npm install -g typescript
Password:
test3#1.0.0 /usr/local/lib/node_modules/test3
$ tsc
-bash: tsc: command not found
The Typescript compiler is never installed. I reinstalled node/npm just now to see if it was an install issue, but that didn't seem to fix it. Any ideas?