Installing Spark-CLI Trouble[SOLVED]

Trying to learn webhooks this afternoon and proceeded by installing node.js and following Kenneth’s instructions.

After typing in the command sudo npm install -g spark-cli I get the following message. I cannot type any characters in after the Password.

Please help me get passed this hurdle.

bens-MacBook-Air:~ bentoskey$ sudo npm install -g spark-cli

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:

are you sure you cannot enter your password? I think you can type just you cant see it(like linux). so type in your password and hit enter if it says error try again but make sure you entered the correct password. let me know how it goes!

2 Likes

Thanks for the quick reply. I’m happy to report that it is now working. :smile:

1 Like

What was the problem? Did it my solution work? Thanks for using the community forums!

1 Like

My newness to this is hazing my understanding of what was wrong, however your suggestion did work.

I’m now further into the example and am generating this:

bens-MacBook-Air:~ bentoskey$ spark webhook create librato.json
Please specify an event name

Any thoughts?

@BenToskey if librato.json is premade and you are calling it maybe it’s asking for a command after you call it like spark webhook create librato.json command
Or maybe it’s asking for an event you want to add you want to the file.
Sorry I’m not that good at spark cli I just knew about the password thing sorry

Hi @BenToskey,

The CLI is telling you either that it can’t find the librato.json file in the same directory as you. If you’re on a mac, you can type open . and it’ll open a finder window in your current folder and you can place the file there. :slight_smile:

Thanks,
David

That helped, as it was previously in the wrong folder. My issues are not yet over…

So here is what I’ve got in librato.json (for this post I used a fictitious username & password):

{
    "eventName": "librato_",
    "url": "https://metrics-api.librato.com/v1/metrics",
    "requestType": "POST",
    "auth": {
        "username": “user.me@gmail.com”,
        "password": "b57a5223b8f44eeb6b4395f8c0b315b6f3f26948e87a5a"
    },
    "json": {
        "gauges": [
            {
                "name": "{{SPARK_EVENT_NAME}}",
                "value": "{{SPARK_EVENT_VALUE}}",
                "source": "{{SPARK_CORE_ID}}"
            }
        ]
    },
    "mydevices": true
}

And here is what I’m now returning in command:

bens-MacBook-Air:~ bentoskey$ spark webhook create librato.json
tryParse error [SyntaxError: Unexpected token “]
Using settings from the file librato.json
Please specify an event name
bens-MacBook-Air:~ bentoskey$

It looks like the editor you used put in “Smart Quotes”:

"username": “user.me@gmail.com”,

Notice how the quotes around “username” differ from the quotes around your username? Make sure you remove all those special quotes and then it should work. :slight_smile:

Thanks,
David

1 Like

Bingo! Thanks, David!

1 Like