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

Odd issue where a dash on the command line gives me a syntax error #322

Closed
danb235 opened this issue Jan 4, 2015 · 2 comments
Closed

Odd issue where a dash on the command line gives me a syntax error #322

danb235 opened this issue Jan 4, 2015 · 2 comments

Comments

@danb235
Copy link

danb235 commented Jan 4, 2015

I am not quite sure where else to ask for help... hopefully this is the right place! =)

I have a cli app written in coffeescript. I have three files in my bin dir:

mediatidy
mediatidy-config
mediatidy-media

If I run bin/mediatidy in the project folder in bash commander executes fine. If I type bin/mediatidy config or bin/mediatidy media in bash commander also executes fine and is waiting for an <action>.

The odd thing is I published the project to npm and get different results when installed globally. If I install the project via sudo npm mediatidy -g (I am using Mac OSX 10.10) I can see the following files in /usr/local/bin/:

mediatidy
mediatidy-config
mediatidy-media

If I run bin/mediatidy in the project folder in bash commander executes fine. If I type bin/mediatidy config or bin/mediatidy media in bash I get the following error:

mediatidy config

/usr/local/lib/node_modules/mediatidy/bin/mediatidy-config:3
program = require 'commander'
                  ^^^^^^^^^^^
SyntaxError: Unexpected string
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Looks like a coffeescript compilation error... wat.

If I run the same command but with the dash, bin/mediatidy-config, it works fine. Any ideas?

@danb235
Copy link
Author

danb235 commented Jan 5, 2015

Dug into this a bit with some help from andyshinn at stackoverflow.

It appears that with v2.1.0 this issue does not exhibit itself. With v2.2.0 a regression occurred breaking this functionality on global installs. This is the PR that caused the regression: #173. See line 409-410 at https://github.com/tj/commander.js/pull/173/files.

I suspected that the issue was fixed with #307. I added this PR in place of the current commander in my package.json file with "commander": "git://github.com/zhiyelee/commander.js.git#buginfo", and my problem is now resolved. Yay!

Let's get #307 merged!

@shadowspawn
Copy link
Collaborator

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

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

No branches or pull requests

2 participants