requirejs/r.js node ./bin/r.js when build -o xxx.js got ILLEGAL

时间:2015-09-01 22:24:15

标签: javascript node.js requirejs r.js

I know there was a little similar questions, but there is no clear solution for this issue. Please for hint how to fix problem with using node modules on windows 7 x64. I read that there is problem with execution scripts from node modules on windows. I read about DOSkeys, but it is not clear solution. Please do not say to change operation system for linux also, because I really think about that (<_<')

When I try

node node_modules/.bin/r.js -o build.js

Got that:

basedir=`dirname "$0"`
        ^
SyntaxError: Unexpected token ILLEGAL
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:4
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Thanks for all clues.

1 个答案:

答案 0 :(得分:-1)

This character ` is a Grave Accent. You can't use it in code. Replace it with a straight single quote as seen below:

'

It is possible that the encoding was incorrect. They can get munged from version control, or switching between platforms, or some sort of pre-compiler action.