[Pkg-javascript-devel] Bug#784439: uglifyjs version failing

Jérémy Lal kapouer at melix.org
Wed May 6 12:08:09 UTC 2015


2015-05-06 13:31 GMT+02:00 Pau Garcia i Quiles <pgquiles at elpauer.org>:

> Package: node-uglify
> Version: 2.4.15-1
>
> Trying to find out the version of uglifyjs on your system fails:
>
> $ uglifyjs --version
>
> module.js:340
>    throw err;
>          ^
> Error: Cannot find module '../package.json'
>    at Function.Module._resolveFilename (module.js:338:15)
>    at Function.Module._load (module.js:280:25)
>    at Module.require (module.js:364:17)
>    at require (module.js:380:17)
>    at Object.<anonymous> (/usr/bin/uglifyjs:118:16)
>    at Module._compile (module.js:456:26)
>    at Object.Module._extensions..js (module.js:474:10)
>    at Module.load (module.js:356:32)
>    at Function.Module._load (module.js:312:12)
>    at Function.Module.runMain (module.js:497:10)
>
> The package.json file does exist:
>
> $ dpkg -L node-uglify
> /.
> /usr
> /usr/lib
> /usr/lib/nodejs
> /usr/lib/nodejs/uglify-js
> /usr/lib/nodejs/uglify-js/transform.js
> /usr/lib/nodejs/uglify-js/utils.js
> /usr/lib/nodejs/uglify-js/output.js
> /usr/lib/nodejs/uglify-js/index.js
> /usr/lib/nodejs/uglify-js/compress.js
> /usr/lib/nodejs/uglify-js/scope.js
> /usr/lib/nodejs/uglify-js/sourcemap.js
> /usr/lib/nodejs/uglify-js/ast.js
> /usr/lib/nodejs/uglify-js/mozilla-ast.js
> /usr/lib/nodejs/uglify-js/package.json
> /usr/lib/nodejs/uglify-js/parse.js
> /usr/share
> /usr/share/man
> /usr/share/man/man1
> /usr/share/man/man1/uglifyjs.1.gz
> /usr/share/doc
> /usr/share/doc/node-uglify
> /usr/share/doc/node-uglify/copyright
> /usr/share/doc/node-uglify/README.md.gz
> /usr/share/doc/node-uglify/changelog.Debian.gz
> /usr/bin
> /usr/bin/uglifyjs
>
> Problem is /usr/bin/uglifyjs looks for it in the wrong place:
>
> $ grep package.json /usr/bin/uglifyjs
>    var json = require("../package.json");


 Hi there,

that's why it's usually simpler and safer to install original hierarchy with
- package.json
- lib/*
in /usr/lib/nodejs/uglify-js, instead of changing it and not installing
package.json.

Regards,
Jérémy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/attachments/20150506/683a93ee/attachment.html>


More information about the Pkg-javascript-devel mailing list