Running r.js from node.js inside Rake throws file lock error

I am using Rake to run the r.js optimizer in node. This is the rake command

sh %{node.exe lib/dist/requireJS/2.1.1/r.js -o app.build.js} do |ok, status|
    ok or fail "r.js build failed"
end

      

This throws the following error

node.exe lib/dist/requireJS/2.1.1/r.js -o app.build.js
Error: EBUSY, resource busy or locked
    at Object.fs.readSync (fs.js:381:19)

      

If I run the same command outside of the rake on the command line, I don't get the error. It looks like a file locking error, but I don't know which file is locked or why it is locked. It may even be a red herring. I would appreciate any ideas you might have.

Thank you in advance

+3


source to share





All Articles