Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a node newbie, I don't understand what to do after install #1

Open
wykydtronik opened this issue Mar 25, 2017 · 7 comments
Open
Labels

Comments

@wykydtronik
Copy link

Sorry about this, I am new to node.js. I found this while looking for a way to tweet from cli.

Scenario 1: accidentally installing in ~/ and making my (Windows) user folder cluttered with node_module
Scenario 2: installing in Documents/cli-tweet to avoid it from being mixed up with other files

Now I am not sure what to do after having it installed. Should I be adding the "tweet.cmd" to my windows PATH? What do I do to auth or config?

Again, pardon my lack of knowledge. Thanks for sharing this repo.

@raed667
Copy link
Owner

raed667 commented Mar 26, 2017

@wykydtronik thank you for your interest in this project.

I realize that the documentation could have been better. I haven't used Windows for a long time, but here is some setup that should work:

  • Open your CMD there and type npm install cli-tweet -g

  • When it finishes you should close your CMD and open a new one

  • Try typing tweet config to configure the tool to use your credentials, it will give you a link that will get you a PIN number to input.

  • If you can't find the command 'tweet' after installing, you should type npm root and add that to your PATH.

Hope this helps

@wykydtronik
Copy link
Author

wykydtronik commented Mar 27, 2017

Hi @RaedsLab !

I got it to work with one minor hick up. When I attempted to use tweet config, I got this error below.

fs.js:640
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EPERM: operation not permitted, open 'C:\Program Files\Git\.tweet.json'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.writeFileSync (fs.js:1333:33)
    at C:\Users\[USERNAME-PLACEHOLDER]\AppData\Roaming\npm\node_modules\cli-tweet\main.js:33:16
    at C:\Users\[USERNAME-PLACEHOLDER]\AppData\Roaming\npm\node_modules\cli-tweet\node_modules\oauth\lib\oauth.js:472:12
    at passBackControl (C:\Users\[USERNAME-PLACEHOLDER]\AppData\Roaming\npm\node_modules\cli-tweet\node_modules\oauth\lib\oauth.js:390:11)
    at IncomingMessage.<anonymous> (C:\Users\[USERNAME-PLACEHOLDER]\AppData\Roaming\npm\node_modules\cli-tweet\node_modules\oauth\lib\oauth.js:409:9)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)

The solution to this was to run Powershell/CMD in Administrator mode. Once I did that, it gave allowed permissions to write the .tweet.json file in that location. I really appreciate your response! I hope this can help anyone that finds your project. :)

@raed667
Copy link
Owner

raed667 commented Mar 28, 2017

@wykydtronik : Thank you for the feedback, I think that I can see what the problem is.

I don't own a machine running Windows, but I will try to make this work as soon as possible. Watch the repo for updates.

@raed667
Copy link
Owner

raed667 commented Mar 28, 2017

@wykydtronik can you try using the code in this branch and telling me if it works on your windows ?

https://github.com/RaedsLab/cli-tweet/tree/windows-support

basic usage should be :

node main.js config

this should create a '.tweet.json' file under your home directory.

If this works I'll merge it and make it available from NPM.

@raed667 raed667 reopened this Mar 28, 2017
@wykydtronik
Copy link
Author

wykydtronik commented Mar 29, 2017

@RaedsLab The installation works without Administrative mode!

As a precaution, I uninstalled and reinstalled it twice on my desktop PC. Also, I tried it on my Windows 10 laptop. I am able to tweet from the command line on both of my Windows 10 machines.

Edit: I was curious to test this on a fresh Win10 installation. I fired up a VM and installed Windows 10 Pro. I installed Node.js and was able to configure cli-tweet within seconds. Looks like it's working great. I didn't have to mess with the PATH but it could be optional work around like my scenario before. I noticed node.js offers including it in the PATH. I am not sure how recent that was but in my case I had to include it on both my laptop and desktop. The VM had it included at installation.

npm install cli-tweet -g
tweet config
echo "Hello Universe" | tweet

@wykydtronik
Copy link
Author

@RaedsLab windows-support branch also works on macOS

@raed667
Copy link
Owner

raed667 commented Mar 30, 2017

@wykydtronik great news! thank you !

I'll merge with master branch and share it on NPM tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants