iron-meteor / iron-cli

A scaffolding command line tool for Meteor applications.
640 stars 82 forks source link

permissions #237

Closed MaxPleaner closed 8 years ago

MaxPleaner commented 8 years ago

I'm surprised to find that my normal shell commands don't work inside the generated directory.

For example I can't run git init without sudo. I'm guessing this is because of write permissions, because the git command is still available to me.

I ran ls -l and saw that the folders' permissions are drwxr-xr-x 9 root root.

I ran chown max:max * to change the permissions to drwxr-xr-x 9 max max, but the permission error remained.

I also tried changing the file permissions recursively using find . -type f -print -exec chmod 777 {} \;, but the permission error remained.

v0.12.7 is returned by both node --version and sudo node --version. Looking at NPM versions, sudo npm -v and npm -v both show 3.5.2.

Is this sudo-requirement to write files intentional? How might it be changed?

MaxPleaner commented 8 years ago

I think I realize what's going on here.

The first time I run iron create, some dependencies are downloaded. This was failing due to a "futures" library installation error. I tried running the iron create command again with sudo and it was successful.

Inside the generated directory, though, I got the reduced-permissions errors I explained previously.

After writing the initial GitHub Issue, I tried running iron create again again found that these permissions errors were gone.

I'm surmising that the sudo access required for me to install iron-cli's dependencies caused reduced permissions in the generated directory, but that running iron create without sudo thereafter doesn't show these errors.

Maybe there should be a separate iron install-dependencies command which requires sudo. This would prevent this unexpected behavior.

MaxPleaner commented 8 years ago

I discovered I also need to use sudo when installing packages via iron. It this isn't a general issue it's fine to close this.