添加到git并将sails.js应用克隆到另一个桌面后,我的应用停止了正常工作。例如我能够成功运行sails lift
命令,但是在尝试加载登录页面时,我看到该页面未正确加载:
并且我在浏览器控制台中收到多个错误(后端控制台是正常的,并且不会删除任何错误):
cloud.setup.js:13 Uncaught ReferenceError: Cloud is not defined
at cloud.setup.js:13
Uncaught ReferenceError: parasails is not defined
at ajax-button.component.js:12
ajax-form.component.js:20 Uncaught ReferenceError: parasails is not defined
at ajax-form.component.js:20
Uncaught ReferenceError: parasails is not defined
at js-timestamp.component.js:15
...
我检查了node_modules文件夹,并在其中包含了parasails。
我没有将node_module包含到我的仓库中,因为克隆后我总是可以运行npm install
。
我设法在桌面上创建并成功运行了一个新的sails.js应用程序,没有任何问题。
因此,我推送或未推送到git的文件一定存在错误。
在.gitignore文件中,我排除了[[dependencies /文件夹。
该规则不包括assets / dependencies
子文件夹中的任何文件,该子文件夹中放置了许多sails.js文件,例如parasails.js等