通过msbuild的Require.js优化器不起作用,但直接在命令行上

时间:2011-10-17 00:02:16

标签: node.js msbuild requirejs

在我的代码中,以下命令在powershell提示符上执行

r.js -o name=main out=main_opt.js baseUrl=.

工作正常并输出以下内容

Tracing dependencies for: main
Uglifying file: C:/Users/Scott/Documents/d/proj/Scripts/Coffee/Directory/main_opt.js

C:/Users/Scott/Documents/d/proj/Scripts/Coffee/Directory/main_opt.js
----------------
C:/Users/Scott/Documents/d/proj/Scripts/Coffee/Directory/DirectoryVM.js
C:/Users/Scott/Documents/d/proj/Scripts/Coffee/Directory/main.js

通过msbuild我得到以下

RequireJSOptimize:
  working dir = C:\Users\Scott\Documents\d\proj\Scripts\Coffee\Directory\
  r.js -o name=main out=main_opt.js baseUrl=.

  node.js:203
          throw e; // process.nextTick error, or 'error' event on first tick
                ^
  Error: Error evaluating module "undefined" at location "undefined":
  TypeError: Cannot call method 'write' of null
  fileName:undefined
  lineNumber: undefined
  http://requirejs.org/docs/errors.html#defineerror
      at makeError (C:\Users\Scott\Documents\d\GitHub\node\lib\node_modules\requirejs\bin\r.js:179:17)
      at execManager 
....
  (C:\Users\Scott\Documents\d\GitHub\node\lib\node_modules\requirejs\bin\r.js:598:17)

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

这是v 0.5.9节点的错误。自固定以来。