# Writing a step in nodejs but it does not run the js file

**URL:** <https://discuss.bitrise.io/t/writing-a-step-in-nodejs-but-it-does-not-run-the-js-file/3942>\
**Category:** Question & Answer\
**Created:** [January 29, 2018, 4:47pm UTC](https://discuss.bitrise.io/t/writing-a-step-in-nodejs-but-it-does-not-run-the-js-file/3942 "2018-01-29T16:47:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kawaiseb](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/kawaiseb/32/893_2.png) [@kawaiseb](https://discuss.bitrise.io/u/kawaiseb)\
**Post date:** [January 29, 2018, 4:47pm UTC](https://discuss.bitrise.io/t/writing-a-step-in-nodejs-but-it-does-not-run-the-js-file/3942/1 "2018-01-29T16:47:37Z")

</div>

Hi i am writing a step in nodejs. I tried this on my bitrise.yml but it doesn’t work.

> workflows:  
> test:  
> steps:  
> - script@1.1.3:  
> inputs:  
> - runner\_bin: node  
> - content: “wetransfertupload.js ${WTU\_FILEPATH}”

With the error :  
private/var/folders/3x/j28tdpd128s57w0qwpz16d440000gq/T/bitrise875221030/step\_src/.\_script\_cont:1  
(function (exports, require, module, \_\_filename, \_\_dirname) { wetransfertupload.js ${WTU\_FILEPATH}  
^

SyntaxError: Unexpected identifier  
at createScript (vm.js:80:10)  
at Object.runInThisContext (vm.js:139:10)  
at Module.\_compile (module.js:599:28)  
at Object.Module.\_extensions…js (module.js:646:10)  
at Module.load (module.js:554:32)  
at tryModuleLoad (module.js:497:12)  
at Function.Module.\_load (module.js:489:3)  
at Function.Module.runMain (module.js:676:10)  
at startup (bootstrap\_node.js:187:16)  
at bootstrap\_node.js:608:3

How to run an external files in nodejs ? Pleeeeeeease. Thanks by advance.

---

<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:** [January 29, 2018, 5:27pm UTC](https://discuss.bitrise.io/t/writing-a-step-in-nodejs-but-it-does-not-run-the-js-file/3942/2 "2018-01-29T17:27:11Z")

</div>

Hi @kawaiseb,

The **Content** should be the (node) script content, not a path **if** you change the runner to `node`.

Alternatively don’t change the runner, keep it on Bash and run the `.js` script with something like this content:

```auto
#!/usr/bin/env bash
set -ex

node wetransfertupload.js ${WTU_FILEPATH}

```

Both should work - the point is, the **Content** input is the actual script content (be it bash, node or anything else) that you want to run.

If you have any questions just let us know! 🙂

---

<div class="post-metadata">

**Author:** ![kawaiseb](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/kawaiseb/32/893_2.png) [@kawaiseb](https://discuss.bitrise.io/u/kawaiseb)\
**Post date:** [January 30, 2018, 10:31am UTC](https://discuss.bitrise.io/t/writing-a-step-in-nodejs-but-it-does-not-run-the-js-file/3942/3 "2018-01-30T10:31:55Z")

</div>

It works great 🙂 Thanks

---

<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:** [January 30, 2018, 10:32am UTC](https://discuss.bitrise.io/t/writing-a-step-in-nodejs-but-it-does-not-run-the-js-file/3942/4 "2018-01-30T10:32:08Z")

</div>

Glad to hear @kawaiseb! 🙂
