Lingbo Tang Lingbo Tang - 3 months ago 82
Node.js Question

chmod does not grant access to resolve the Error: spawn EACCES

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?

Answer

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

Comments