我在 Windows 7 机器上,我最近从 NodeJS.org 安装了最新版本的 Node
然后我跑了...
C:\Users\jcreamer>npm install -g uglify-js
npm http GET https://registry.npmjs.org/uglify-js
npm http 304 https://registry.npmjs.org/uglify-js
C:\Users\jcreamer\AppData\Roaming\npm\uglifyjs -> C:\Users\jcreamer\AppData\Roaming\npm\node_modules\uglify-js\bin\uglifyjs
uglify-js@1.2.3 C:\Users\jcreamer\AppData\Roaming\npm\node_modules\uglify-js
并重新启动命令提示符,但我仍然无法运行...
cd c:\inetpub\wwwroot\app\
node uglifyjs -o app.min.js app.js
我得到这个错误...
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'C:\Inetpub\wwwroot\analytics\uglifyjs'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
还有什么我需要做的吗?
更新
即使在我以管理员身份运行 npm 之后,如果我运行
C:\Users\jcreamer>uglifyjs
我得到...
C:\Users\jcreamer>"C:\Users\jcreamer\AppData\Roaming\npm\\.\node_modules\uglify-js\bin\uglifyjs"
'"C:\Users\jcreamer\AppData\Roaming\npm\\.\node_modules\uglify-js\bin\uglifyjs"' is not recognized as an internal or external comm
and,
operable program or batch file.