0

我使用 create 命令创建了一个文件“测试”,所以我有两个文件。一个 html 和一些其他的 js 文件。现在我想编译所有的 js 文件,所以我在命令提示符中使用这一行: C:\limejs\bin>lime.py build test -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
4

1 回答 1

0

当 Google Closures Compiler 找不到您的文件时,就会发生该错误。确保在“test.js”(或具有您的 javascript 入口点的任何文件)中具有以下行:

goog.provide("test")

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

于 2014-06-11T05:19:32.217 回答