hoodiehq-archive / my-first-hoodie

⛔ deprecated
Other
157 stars 35 forks source link

sudo npm install -g local-tld does not behave as expected #15

Closed adamyeats-zz closed 11 years ago

adamyeats-zz commented 11 years ago

When running through the install steps in the README, I assumed that I should probably run npm install -g local-tld as sudo, as I do with most other global Node module installations. When running as sudo, the script tries to run launchctl and asks for my sudo password for a second time, only now my regular password does not work.

Here's a dump from my console:

npm http GET https://registry.npmjs.org/local-tld
npm http 304 https://registry.npmjs.org/local-tld

> local-tld@3.0.6 preuninstall /Users/adamyeats/.nvm/v0.10.5/lib/node_modules/local-tld
> ./bin/local-tld-uninstall

++ id -u
+ '[' 4294967294 -eq 0 ']'
+ SUDO=sudo
+ sudo launchctl unload /Library/LaunchDaemons/ie.hood.local-tld-firewall.plist

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
Sorry, try again.

Running the install without sudo works as expected.

Install target is a Mac running 10.8.3 and Node v0.10.5.

I realise that this is not a bug with Hoodie and I am, of course, at fault as I didn't follow the instructions to the letter, however I think it's fair to assume that others will make the same mistake I have as it is often a requirement to run global module installs with sudo.

Unless anyone can establish if this is an issue local to my machine, can I suggest a slight tweak to the docs that explicitly says not to run npm install -g local-tld as sudo? Happy to submit the PR myself.

janl commented 11 years ago

You are correct, local-tld needs to NOT be run as sudo and this should be made more clear. I didn’t realize people would have a non-user-writable gobal node_modules folder. If you send a PR, I’m happy to merge it right away.

adamyeats-zz commented 11 years ago

Closing as docs are now updated. :)