After initially having this problem, but with a longer error report, I uninstalled node and all the associated modules, installed nvm (Node Version Manager), then reinstalled node. Still no luck.
I am fairly new to using the command line to install software and to the way permissions can come into play. From what I’ve read on this forum and StackOverflow, I shouldn’t have to use sudo to set up ionic. Is this right? I was hoping to install without it, if that’s the best practice, but I guess at a certain point, I’ll just do whatever works.
I haven’t been using linux that long, maybe 3 years or so, but I have never heard that using sudo was bad practice. Here is an article on using sudo (specifically on the ubuntu OS).
If I run the command to install ionic without sudo I get similar errors to you. In the documentation for the package Ionic states: “Note: For a global install of -g ionic, OSX/Linux users may need to prefix the command with sudo.”
@lukeb@edd Right. The only time you will have to use sudo is when the command is modifying files that are owned by root. My build folder is owned by root, therefore if I don’t use sudo when doing ionic build, I will get errors that it couldn’t remove the files.
drwxr-xr-x@ 6 root staff 204 Nov 19 09:48 build
If I change the ownership of the entire app to my user account:
$ sudo chown -R userName myApp/
Then I can run the build command without sudo without getting any errors