mishoo/UglifyJS — Issue #270: Broken executable in NPM install on Windows
Author: mourner
Created: 2011-12-10 11:33:37+00:00
State: open

Hi, as you may know, latest versions of Node now have a Windows installer bundled with NPM, and everything is working seamlessly under Windows now. But for some reason, NPM generates incorrect executable for UglifyJS (that doesn't work under Windows by default) while it works correctly for other packages.

Generated by default for UglifyJS:

```
"%~dp0\.\node_modules\uglify-js\bin\uglifyjs" %*
```

Modified to make it work under Windows (the same code is generated by default for other packages, for example jshint):

```
@IF EXIST "%~dp0"\"node.exe" (
"%~dp0"\"node.exe" "%~dp0\.\node_modules\uglify-js\bin\uglifyjs" %*
) ELSE (
node "%~dp0\.\node_modules\uglify-js\bin\uglifyjs" %*
)
```

I would think that this is an NPM problem but other packages I installed generate correct executables by default (cake, coffee, jake, jshint, etc.), so there must be something with UglifyJS NPM configuration.