question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NodeJS shebang (#!) line issue

See original GitHub issue

Hi,

I tried to use obfuscator on my project and got an issue with a shebang line

#!/usr/bin/env node

This is not a javascript comment line and i can’t disable obfuscator on it with a comment

// javascript-obfuscator:disable

because it needs to be at first line. How can i deal with ? I think i may delete it before obfuscator runs and inject it after processing my file.

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sanex3339commented, Feb 6, 2018

So, shebang doesn’t handled by esprima, you need to cutoff it before obfuscation. https://github.com/jquery/esprima/issues/1151

0reactions
sanex3339commented, Mar 14, 2020

Will be supported in the upcoming 0.26.0. Will release it tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node shebang line results in error since Node.js 12.16.0 #178
This commit checks the first line for shebang declarations and removes them before trying to load the module.
Read more >
Node.js shebang - Alex Ewerlöf
Shebang or hashbang ( #! ) is the first line of the file which tells the OS which interpreter to use. It typically...
Read more >
What exactly does "/usr/bin/env node" do at the beginning of ...
Specifically, you need a shebang line to create CLIs based on Node.js source files as part of an npm package, with the CLI(s)...
Read more >
Universal Node.js shebang? - Unix & Linux Stack Exchange
The first line is, obviously, a Bourne shell shebang. Node.js bypasses any shebang that it finds, so this is a valid javascript file...
Read more >
Build a Command Line Application with Node.js
Learn how to build command line applications using Node.js. ... The first line that begins with #! is usually called a “shebang.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found