0

I'm trying to install uglifyjs on my computer from local folders.

I downloaded all dependencies of uglifyjs, including dependencies of dependencies, and they are all available in my folder C:\npm\node_modules

I'm working on Windows XP, and when I'm trying to install uglify-js from \node_modules\uglify-js using the command npm install -g node_modules\uglify-js (global because I'm on a Windows machine, to be able then to execute uglifyjs using the command: uglifyjs -o output.js input.js) it's trying to download dependencies from Internet (I can't because I'm under a security proxy, that's why I downloaded all dependencies manually)

enter image description here

I tried to install all dependencies manually, it seems to work fine though

npm list:

enter image description here

This is all folders on my node_modules folder

enter image description here

I installed uglify-js without global command -g, it worked fine

enter image description here

But when I execute the uglifyjs command node C:\npm\node_modules\.bin\uglifyjs output.js input.js, I have this error:

enter image description here

Do you have any suggestion?

Thanks.

5
  • You don't have to install node modules globally on a Windows machine. Are you using uglify from the command-line or something? If so, you may just need to add something to your environment PATH. Commented Feb 10, 2014 at 21:45
  • I tried to install it without-g . The installation worked fine. Though, when I execute the command: C:\npm\node_modules\.bin\uglifyjs -o output.js input.js, I got this error: basedir='dirname "$0$' SyntaxError: Unexpected token ILLEGAL Commented Feb 10, 2014 at 21:46
  • Have you tried just doing npm install from the local directory? Are you using a package.json file? If so, you should be able to specify the repo where it lives. Commented Feb 10, 2014 at 21:52
  • That's what I did yes. I just edited the post with more information Commented Feb 10, 2014 at 21:58
  • Are those backticks? `` Commented Feb 10, 2014 at 22:47

1 Answer 1

2

If those are backticks wrapping your dirname, try changing them to single quotation marks:

basedir='dirname "$0"'

instead of

basdir=`dirname "$0"`
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! I don't know why it was backticks, I think there is a bug from the library!
My pleasure. Let the original dev know if it's a library bug. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.