在给出sails lift命令时,我收到以下错误。该命令刚刚开始工作,并且突然停止工作
error: A hook (`controllers`) failed to load!
error: SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\node_modules\include-all\index.js:129:29
at Array.forEach (native)
at requireAll (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\node_modules\include-all\index.js:44:9)
at buildDictionary (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\node_modules\sails-build-dictionary\index.js:68:14)
at Function.module.exports.optional (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\node_modules\sails-build-dictionary\index.js:160:9)
at Hook.loadControllers (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\lib\hooks\moduleloader\index.js:313:23)
at Hook.wrapper [as loadControllers] (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\node_modules\lodash\index.js:3095:19)
at Hook.loadAndRegisterControllers (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\lib\hooks\controllers\to-load-and-register-controllers.js:33:19)
at Hook.initialize (C:\Users\All Users\AppData\Roaming\npm\node_modules\sails\lib\hooks\controllers\index.js:59:12)
答案 0 :(得分:0)
没有你的代码,很难说。您的控制器呼叫可能存在错误。检查你的报价,也许你输入两个这样的引号:
ng-controller=""mycontroller" <!-- error -->
或
ng-controller='my_controller" <!-- error -->
或者只是一个随机字符,您可能无意中写在文件的随机位置。在这种情况下,并且在使用版本控制系统(git,svn)开发项目的情况下,您可以通过在项目的根目录执行命令git(or svn) diff
来显示自上次提交以来的最近修改。
答案 1 :(得分:0)
您可以在运行项目时看到错误详情
sails lift --silly