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.

alexmngn
  • 9,107
  • 19
  • 70
  • 130
  • 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. – samanime Feb 10 '14 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 – alexmngn Feb 10 '14 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. – samanime Feb 10 '14 at 21:52
  • That's what I did yes. I just edited the post with more information – alexmngn Feb 10 '14 at 21:58
  • Are those backticks? `` – Jackson Egan Feb 10 '14 at 22:47

1 Answers1

2

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

basedir='dirname "$0"'

instead of

basdir=`dirname "$0"`
Jackson Egan
  • 2,715
  • 4
  • 18
  • 26