limejs无法编译

时间:2014-03-25 16:05:02

标签: javascript html5 compilation limejs

我使用create命令创建了一个'test'文件,所以我有两个文件。一个html和一些其他的js文件。现在我想编译所有的js文件,所以我在commandprompt中使用这一行: C:\ limejs \ bin> lime.py构建测试-o test / compiled.js

我正在使用Windows 8

但我唯一收到的就是这个错误:

Traceback (most recent call last):
  File "C:\limejs\closure\closure/bin/build/closurebuilder.py", line 265, in <mo
dule>
    main()
  File "C:\limejs\closure\closure/bin/build/closurebuilder.py", line 234, in mai
n
    deps = [base] + tree.GetDependencies(input_namespaces)
  File "C:\limejs\closure\closure\bin\build\depstree.py", line 80, in GetDepende
ncies
    namespace, [], self._provides_map, []):
  File "C:\limejs\closure\closure\bin\build\depstree.py", line 118, in _ResolveD
ependencies
    raise NamespaceNotFoundError(required_namespace)
depstree.NamespaceNotFoundError: Namespace "test" never provided.

我认为这可能是因为我无法在Windows命令提示符下使用-o但我真的不知道导致此错误的原因。

现在我已经完成了我收到此错误:

C:\limejs\closure\closure/bin/build/closurebuilder.py: Scanning paths...
C:\limejs\closure\closure/bin/build/closurebuilder.py: 1464 sources scanned.
C:\limejs\closure\closure/bin/build/closurebuilder.py: Building dependency tree.
.
Traceback (most recent call last):
  File "C:\limejs\closure\closure/bin/build/closurebuilder.py", line 265, in <mo
dule>
    main()
  File "C:\limejs\closure\closure/bin/build/closurebuilder.py", line 254, in mai
n
    compiler_flags=options.compiler_flags)
  File "C:\limejs\closure\closure\bin\build\jscompiler.py", line 125, in Compile

    java_version = _ParseJavaVersion(_GetJavaVersionString())
  File "C:\limejs\closure\closure\bin\build\jscompiler.py", line 37, in _GetJava
VersionString
    return subprocess.check_output(['java', '-version'], stderr=subprocess.STDOU
T)
  File "C:\Python27\lib\subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['java', '-version']' returned non-zero
exit status 1

1 个答案:

答案 0 :(得分:0)

当Google Closures编译器无法找到您的文件时,会发生该错误。确保&#34; test.js&#34; (或者你的javascript入口点有哪个文件)有一行:

goog.provide("test")

检查Limejs指南: http://www.limejs.com/0-getting-started