问题
I have installed sails successfully using npm install sails -g I am running Windows 7. When I tried to run the 'sails' command, got error saying "command not found". Then I included the corresponding bin folder in PATH env variable. Then getting javascript error while trying to run 'sails' command. ERROR::
Line: 1
Char: 1
Error: Invalid character
Code: 800A03F6
Source: Microsoft JScript compilation error
回答1:
This happens because you need to run sails.js with node.bat. To do so, first make sure your path variable is updated with the location of your node install:
PATH=%PATH%;c:\program files\nodejs
Then make a c:\program files\nodejs\sails.cmd file with the following contents
node C:\Users\XXXXX\AppData\Roaming\npm\node_modules\sails\bin\sails.js %1 %2 %3 %4 %5
Replace XXXX with your user profile name. Save it and you should be all sorted. Thanks to this post for some inspiration.
来源:https://stackoverflow.com/questions/28083379/running-sails-throwing-invalid-character-error