I'm using node v6.4.0, npm v3.10.3, and ionic 1. I'm gettiing Error: spawn EACCES when I tried to add ios platform by: sudo ionic platform add ios or sudo cordova platform add ios.
Then I tried sudo ionic hooks add, and sudo chmod +x hooks/after_prepare/010_add_platform_class.js which was discussed in How to fix Error: spawn EACCES.
When it didn't work for me, I tried sudo chmod 777 /Users/<username>/.config/configstore/insight-cordova.json and sudo chmod 744 ~/.config/configstore/update-notifier-cordova.json. They didn't help me either. I want to know is there anything else I'm missing which can cause this error?
It is an permission issue obviously, and when you are using sudo chmod 777 -R hooks/ you are doing it wrong. Because the correct syntax is sudo [Your mode] [Your behavior flag] [Your path]. The easiest way to solve this problem is sudo as super user: sudo su on the root folder. Then You can directly run ionic platform add ios
This method worked for me.
Install dos2unix by using "sudo apt-get install dos2unix" this
command.
Then run this command "dos2unix 010_add_platform_class.js".
After that add platform again.
Related
I'm trying to install Vue CLI on ubuntu 20.04 with the following command:
sudo npm install -g #vue/cli
I got permission denied error
2021/06/13 14:35:24.163955 cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/4749": mkdir /nonexistent: permission denied
I used the following code to solve the permission denied problem in the directory that I'm developing the project but the solution did not solve the problem
chmod -R 777 /Desktop/vuejs
I founded the solution because I installed node js using Snap package from Snap Store, which has different permission caused the problem. installing Vue CLI using npm needed permission for making a directory in the snap directory, even changing permissions to 777 in the snap directory is not a good solution becouse changing file system directories permission like snap or usr hurts your ubuntu operation system, in my case after changing usr and snap directory permission to 777 my root permission gone and I had to reinstall ubuntu operation system
you can install node js version 14.x using apt with the following command
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
also the following link is useful to install other nodejs versions
nodejs debinstall
When I tried to install Python 3 through Homebrew,
I got the following message. How can I fix this error?
I’m not familiar with command line, so I would appreciate
if you could provide me with the exact commands to execute
to resolve the issue.
Error: The following directories are not writable by your user:
/usr/local/share/man/man7
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man7
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man7
You have to change ownership on the mentioned directory by running the command:
sudo chown -R $(whoami) /usr/local/share/man/man7
None of the other answers worked for me.
I solved it by running
sudo chown -R $(whoami) /usr/local/share
Instead of the specific path it was asking.
I was also getting the same error all of sudden while it was working fine till yesterday. well resolved it by changing the ownership with below command:-
sudo chown -R $<whoami>:<id -g> /usr/local/share/man/man7
id -g is to get the group name and whoami to get the username.
Came across this exact error recently when I tried to install mySQL : The following directories are not writable by your user:
I followed the below steps that fixed it :-
Run the below command lines in your terminal
brew doctor
This will take a while to run, once completed it will highlight some warnings that will help with debugging if any issues. For me, It prompted the below.
Broken symlinks were found. Remove them with brew cleanup
The issue was fixed finally after running brew cleanup, and I was able to then download MySQL with the below command with no issues.
brew install mysql
I'm trying to install globally some packages for my Unix environment on Windows with WSL. I use nvm to manage the different versions of Node.js.
The problem is while using the sudo command before a global npm install :
sudo npm install --global prompt-pure
I get an error: sudo: npm: command not found !
Doing a simple npm install --global pure-prompt will work, but as I'm not super user, the global installation ends up with a permission error.
How can I fix this annoying problem and keep nvm ?
Thanks by advance
When you try to run sudo npm, it tries to run the npm binary file /usr/bin/npm but your binary is located in a different place, which can be found running which npm.
Example: /home/damo/.nvm/versions/node/v8.11.1/bin/npm
The solution is to create a link in /usr/bin/ pointing to the actual binary:
sudo ln -s "$(which npm)" /usr/bin/npm
You can also add the following link so you can run sudo node
sudo ln -s "$(which node)" /usr/bin/node
For me I needed to actually cheat and run as root before installing node as root. For this I ran sudo su in a Ubuntu WSL term and then installed node.
Once I did that I could sudo su then npm run special-script.
I don't know a better way to get a script to attach to restricted ports like 443 for testing https connections but it works.
As you will find in the man file for sudo man sudo sudo will execute a command as another user. That other user has a different home directory to you and access to different commands
When i run sudo which node i get nothing, but which node returns /home/damo/.nvm/versions/node/v8.11.1/bin/node
Lets look at your actual goal. You say you are trying to install pure-prompt, i know this does not ask your explicit question but given you have zsh installed have you tried oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh) i use this on every install of linux i ever have to work with (VMs, WSL, docker). Very customizable and looks great out of the box.
I am attempting to set up node without using sudo on my mac. I followed this link http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/.
I already had node on the mac I am using. So I followed the steps for Already Have Node?
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf ~/.npm
However, the third step
brew uninstall node
Is giving me an odd error
No such keg: /usr/local/Cellar/node
I checked to see if I have homebrew with
brew help
I still have it.
It looks like that path is gone. This seems to be a common link to follow this procedure so I am not sure what I am missing. Any feedback would be much appreciated.
Thanks.
The way I have overcome this I installed node like normal using brew:
brew install node
Then I do:
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib/node_modules
I have installed npm to setup Ionic & Cordova - and I have used sudo for this?
My question is when I run the following command without sudo I get an error:
cordova emulate ios
The error is an
EACCES, permission denied ..... /ios.json
Am I right that if I cannot use this 'basic' cordova command without running sudo my installation has been screwed up somehow?
I did the following on the terminal to allow me to run the commands without using sudo (this might help someone)
sudo chown -R $(whoami) ~/Documents/mobileapps
This meant the cordova emulate ios command now runs! finally!