Running sails throwing invalid character error

两盒软妹~` 提交于 2019-12-12 22:12:51

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!