title: How to ignore node shebang error in Eclipse?
body: <p>I am writing some node command line utilities.  They all start with the line:</p>
  
  <pre><code>#!/usr/bin/env node
  </code></pre>
  
  <p>With Eclipse Juno and the Nodeclipse Node.js plugin, this line of code produces an error as shown:</p>
  
  <p><img src="https://i.stack.imgur.com/M006w.png" alt="Node shebang eclipse error"></p>
  
  <p>OK, so <code>#</code> is not a valid comment character in javascript, but it is a valid character in Linux/UNIX as the <strong>shebang</strong> of the first line in a file.  But how can I set up Eclipse to ignore this error?  This is a problem for me because code formatting does not work if you have errors.  I have to delete the line.  Hit <kbd>CTRL-SHIFT-F</kbd> and add the line back.</p>
  
  <p>I have tried a lot of things and researched, but I can't find an answer.</p>
  
  <p>There is a duplicate question out there, <a href="https://stackoverflow.com/questions/17192446/eclipse-javascript-syntax-error-on-hashbang-line">eclipse javascript syntax error on hashbang line</a>, but my question has more info.</p>
  
  <h3>EDIT:</h3>
  
  <p>Looks like there was something added to <a href="https://github.com/jshint/jshint/issues/66" rel="nofollow noreferrer">jshint to allow shebangs in the first line</a>.  Maybe I need to update my node-eclipse, or maybe the node-eclipse project needs to update jshint?</p>
  
  <ul>
  <li>My jshint eclipse integration is version 0.9.6.</li>
  <li>My nodeclipse is 0.4.0.20130519...</li>
  </ul>
  
  <p>I upgraded to </p>
  
  <ul>
  <li>jshint eclipse integration 0.9.9.20131029</li>
  <li>nodeclipse 0.7.0.20131101</li>
  </ul>
  
  <p>That did not help.</p>
  
  <p>Here is my JSHint version in eclipse:</p>
  
  <p><img src="https://i.stack.imgur.com/e7gKy.png" alt="enter image description here"></p>
  
  <h3>EDIT 2:</h3>
  
  <p>Thanks for the answer VonC.  But I think this shows that I do not have a BOM in the file.  Any other ideas?</p>
  
  <pre><code>$ od -N 20 -t x1 hello.js
  0000000 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 6e
  0000020 6f 64 65 0a
  0000024
  </code></pre>
  
  <h3>EDIT 3:</h3>
  
  <p>With regard to Paul Verest's answer below, I tried to turn off JSDT validation, but I can't seem to do it.  I unchecked "Enable JavaScript semantic validation" (In Eclipse, see Window > Preferences > JavaScript > Validator > Errors/Warnings), but the issue remains.</p>
  
  <p>I am now uninstalling <strong>Eclipse Web Developer Tools 3.4.2</strong>. That did not seem to help and now my CSS and HTML editors are gone.  Now I have tried to disable JSDT validation by following some of the ideas in this SO question, <a href="https://stackoverflow.com/questions/3131878/how-do-i-remove-javascript-validation-from-my-eclipse-project">How do I remove javascript validation from my eclipse project?</a>.</p>
  
  <p>So I went into my project properties and went to JavaScript > Validation.  I have set everything to "Enabled project specific settings" and unchecked "Errors/Warnings", "JSDOC", etc.  Even so, I think validation is still running since the problem persists!  My "Builders" Properties only lists the "JSHint Problem Checker" which is enabled.  (I am doing all this on a new test project with a hello.js).</p>
  
  <h3>EDIT 4, THE ANSWER</h3>
  
  <p>It was not easy, but I ended up hacking the .project file in Eclipse.  I had this:</p>
  
  <pre><code>&lt;natures&gt;
      &lt;nature&gt;org.nodeclipse.ui.NodeNature&lt;/nature&gt;
      &lt;nature&gt;org.eclipse.wst.jsdt.core.jsNature&lt;/nature&gt;
  &lt;/natures&gt;
  </code></pre>
  
  <p>I removed the jsdt nature and now the error on the shebang line is GONE!  I did this in my test project and my real project.  It worked!  This is actually pretty helpful since I can format the file and I'm actually running jshint now. </p>