Question: So here is my code 

```
<button class="btn-new"><i class="ion-ios-plus-outline"></i>New game</button>
<button class="btn-roll"><i class="ion-ios-loop"></i>Roll dice</button>
<input type="text" placeholder="Target" class="target">

document.querySelector('button.btn-roll').addEventListener('click', function(){
    var input = document.querySelector('.target').value;
    if(input){
        var winningScore = input
    }else {
        winningScore = 100;
    }
document.querySelector('.btn-new').addEventListener('click',function(e,input){
    input = '';
  })
})  

```

I am assigning the value entered in the input field to a variable when user clicks on roll dice button and trying to empty the input field making it " " when the user clicks on new game button. This doesn't throw an error but I am still able to see the value even when I click the new game button. I also see the input field getting emptied when I write it as `document.querySelector('.target').value = ' ';` 
but doesn't work when I write it just using the variable name `input = '';`. 

Can someone please tell me whats the mistake in the code here ?.

Answer: 
Currently only NodeJs v6 is supported by SPFx.

Please uninstall your current Node and install `v6.11.5`. Also, ensure that you have installed `npm` version 3.

Reference - [Set up your SharePoint client-side web part development environment](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment)
I just noticed the screenshot on you answer, it says that the Node Version is : v8.9.1

[![enter image description here](https://i.stack.imgur.com/Qyrlv.png)](https://i.stack.imgur.com/Qyrlv.png)

While working with SPFx on Node.js v8 you have to run gulp serve as:

`NODE_NO_HTTP2=1 gulp serve`

Try to use it. Hope it works for you.

Also refer this thread : <https://github.com/SharePoint/sp-dev-docs/issues/1002>