我得到了同樣的錯誤,那是因爲我用的是「帆升降機」和文檔說要用「節點app.js」。一旦我使用「節點app.js」啓動應用程序,它按預期工作。
sails lift
info: Starting app...
error: A hook (`controllers`) failed to load!
error: `include-all` attempted to `require(/research/typeScriptPackage/testing/api/controllers/TsController.ts)`, but an error occurred::
Details:/research/typeScriptPackage/testing/api/controllers/TsController.ts:1
(function (exports, require, module, __filename, __dirname) { import util = require('util');
這是一步我錯過:
「5.啓動您的應用程序與節點app.js,而不是帆舉。」
node app.js
info:
info: .-..-.
info:
info: Sails <| .-..-.
info: v0.12.13 |\
info: /|.\
info: /|| \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `/research/typeScriptPackage/testing`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: -------------------------------------------------------
debug: :: Fri Jul 14 2017 08:20:04 GMT-0700 (PDT)
debug: Environment : development
debug: Port : 1337
debug: -------------------------------------------------------
您使用的是什麼版本的Sails? – sgress454