# Unable to see node output - Need help

**URL:** <https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585>\
**Category:** Question & Answer\
**Created:** [February 3, 2017, 2:01pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585 "2017-02-03T14:01:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![uidzer0](https://avatars.discourse-cdn.com/v4/letter/u/a4c791/32.png) [@uidzer0](https://discuss.bitrise.io/u/uidzer0)\
**Post date:** [February 3, 2017, 2:01pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/1 "2017-02-03T14:01:52Z")

</div>

Presently I’m working on a custom step to assist with necessary Jira actions. You can view it here, if you’d like to help [View Repository](https://github.com/loudbinary/bitrise_report_to_jira).

In the step.sh.old you’re able to see what I was originally doing, but when I ran the job the it hung, timed out, and then eventually failed. First I battled the execution path problems, which i’m not sure it worked out… yet that error went away. Once it continued then it just hung as described above. I assume it was because of missing input variables, however I can directly see that because no error gets emitted.

As a test… I replaced my [step.sh](http://step.sh) with a simple; console.log(‘hello’) - In hope to see that message in the bitrise logs… But alas I see nothing.

What am I doing wrong… Got a couple other questions on this topic of custom steps, but will place in separated thread.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 3, 2017, 2:16pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/2 "2017-02-03T14:16:20Z")

</div>

> [@uidzer0](#):
>
> but when I ran the job the it hung

How did you run it?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 3, 2017, 2:17pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/3 "2017-02-03T14:17:33Z")

</div>

There’s also no need for this: [https://github.com/loudbinary/bitrise\_report\_to\_jira/blob/master/step.sh#L67](https://github.com/loudbinary/bitrise_report_to_jira/blob/master/step.sh#L67)

Instead of

```auto
output=$(npm install);
echo "$output";

```

you could simply

```auto
npm install

```

if you don’t use the output as a variable (which it seems you don’t).

---

<div class="post-metadata">

**Author:** ![uidzer0](https://avatars.discourse-cdn.com/v4/letter/u/a4c791/32.png) [@uidzer0](https://discuss.bitrise.io/u/uidzer0)\
**Post date:** [February 3, 2017, 2:22pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/4 "2017-02-03T14:22:02Z")

</div>

I created a very small build job in Bitrise.

```
---
format_version: 1.3.4
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
  - push_branch: "*"
  workflow: primary
- pull_request_target_branch: "*"
 pull_request_source_branch: "*"
   workflow: primary
   - tag: "*"
    workflow: primary
    workflows:
      primary:
        steps:
        - activate-ssh-key@3.1.1: {}
        - nvm@1.0.1:
        inputs:
        - node_version: 6.9.4
        - git::https://github.com/loudbinary/bitrise_report_to_jira.git@master:
        title: Report to Jira
        inputs:
        - jira_url: https://loudbinary.atlassian.net
        - jira_user: loudbinary@gmail.com
        - jira_password: SomeRandomandLessThanUseFul
        - jira_default_project: LWS
        - jira_default_issue_type: Bug
        - jira_port: 443
        - jira_create_missing: true
```

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 3, 2017, 2:24pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/5 "2017-02-03T14:24:52Z")

</div>

Did you try to run it locally, with the Bitrise CLI?

---

<div class="post-metadata">

**Author:** ![uidzer0](https://avatars.discourse-cdn.com/v4/letter/u/a4c791/32.png) [@uidzer0](https://discuss.bitrise.io/u/uidzer0)\
**Post date:** [February 3, 2017, 2:29pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/6 "2017-02-03T14:29:57Z")

</div>

No… not via your cli. I did verify my node script runs successfully, if given the parameters.

I will however, run it specifically with the relative path to my local steplib collection. Will let you know in a few.

That said, I had to go through examples to find what I believe is the appropriate method in [step.sh](http://step.sh) to find the path of my imported step. But honestly I’m not sure this is correct. I assume this custom step with git::https is simply pulling into local collection cache?? Bear with me, only a day or so into this custom step stuff.

```
THIS_SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
```

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 3, 2017, 2:34pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/7 "2017-02-03T14:34:52Z")

</div>

> [@uidzer0](#):
>
> I assume this custom step with git::https is simply pulling into local collection cache??

Correct, that’s a random directory.

> [@uidzer0](#):
>
> I had to go through examples to find what I believe is the appropriate method in step.sh to find the path of my imported step

Correct, see e.g. this step, which is written entirely in Ruby: [https://github.com/bitrise-io/steps-amazon-s3-deploy/blob/master/step.sh](https://github.com/bitrise-io/steps-amazon-s3-deploy/blob/master/step.sh)

The `step.sh` of the step is as simple as:

```auto
#!/bin/bash

THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -e

ruby "${THIS_SCRIPT_DIR}/s3deploy.rb"

```

It just gets the `step.sh` file’s _directory_ path with `THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"`, and then it runs the `s3deploy.rb` which is in the same directory as the `step.sh`.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 3, 2017, 2:37pm UTC](https://discuss.bitrise.io/t/unable-to-see-node-output-need-help/585/8 "2017-02-03T14:37:03Z")

</div>

> [@uidzer0](#):
>
> No… not via your cli.

You definitely should! 😉

And it’s actually quite simple, if you follow the Step Template: [GitHub - bitrise-steplib/step-template: Step template - DEPRECATED, please use the `step` plugin and its built in template instead (https://github.com/bitrise-core/bitrise-plugins-step/tree/master/create/templates)](https://github.com/bitrise-steplib/step-template#how-to-use-this-step)
