将节点针项目从Linux移动到Windows - 现在它不会构建

时间:2012-07-19 07:44:03

标签: windows node.js coffeescript node-stitch

我收到的错误并没有多大意义。这是进行咖啡编译的my Cakefile的一部分:

buildsrc: ->
    stitch = require 'stitch'
    fs = require 'fs'

    # Create stitch package
    pkg = stitch.createPackage
        paths: [__dirname + '/src']
        dependencies: [
            __dirname + '/vendor/jquery-1.7.1.min.js'
            __dirname + '/vendor/jquery-ui-1.8.18.min.js'
            __dirname + '/vendor/jquery.cookie.js'
            __dirname + '/vendor/jquery.iframe-transport.js'
            __dirname + '/vendor/jquery.fileupload.js'
        ]

    # Compile the package
    pkg.compile (err, src)->
        if err
            console.warn 'Coffee compile failed:'
            console.warn err.toString()
        else
            # Save the source code
            fs.writeFile BUILD_JS_PATH, src, (err)->
                if err then throw err
                console.log 'Compiled src to ' + BUILD_JS_PATH

运行那个(缩短路径)的输出:

Coffee compile failed:
Error: C:\Users\Codemonkey\...\project\src\foo.coffee isn't in the require path

这在Linux上使用相同的代码和相同的节点,针脚和咖啡脚本版本非常有效。我可以看到stitch.coffee:177中出现了错误,但我无法弄清楚它的意义,如果这是我的错,或者如何解决它。

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

是的,这是Windows的目录分隔符问题 - 我发现了一个未解决的拉取请求来解决问题 - https://github.com/sstephenson/stitch/pull/34