javascript - 关闭编译器: ERROR - cannot read

标签 javascript google-closure-compiler

我从 Google 官方网站 ( https://developers.google.com/closure/compiler/docs/gettingstarted_app ) 下载了 Google Closure Compiler。然后运行它来缩小我的 widget.js 但我收到以下错误:

C:\Users\Administrator\Downloads\compiler-latest>java -jar compiler.jar --js "wi dget.js" \ --js_output_file "output.js" ERROR - Cannot read: \

1 error(s), 0 warning(s)

enter image description here

我尝试更改我的 widget.js 内容,如果 widget.js 包含一些语法错误它会告诉我。但即使我的 widget.js 为空或只有一行警报('test'),“错误 - 无法读取”似乎总是出现;

如何解决该错误?

最佳答案

您应该按如下方式运行编译器:

java -jar compiler.jar --js widget.js --js_output_file output.js

您可以放置​​多个 js 文件,并用空格分隔,而不像您的情况那样使用双引号 (")、单引号 (') 或斜杠 (/)。

希望这有帮助。

关于javascript - 关闭编译器: ERROR - cannot read,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23886858/

相关文章:

Javascript - 在类的函数成员中正确使用 'this'

javascript - Google Closure Compiler - 基于 externs 的死代码移除

javascript - 当使用 apply() 和 call() 方法很容易继承时,为什么人们在 JavaScript 中使用原型(prototype)?

javascript - 如何让网络摄像头与 AngularJS 一起工作?

javascript - 仅在按下 Enter 时允许剑道网格服务器过滤 API 调用

google-closure-compiler - 我可以关闭外部库的 Closure Compiler 警告吗?

javascript - 谷歌闭包编译器和 jquery

javascript - 我的源映射断点在 Google Chrome 中无法正常工作

javascript - Angular 4 setInterval 意外行为

javascript - 如何使用 Angular 在元素内编写 HTML