简体   繁体   中英

Sails fails to lift

On giving the sails lift command I get the following error. The command was working a few moments ago and has stopped working all of a sudden

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)

您必须在registerControllers.js第33行中修复语法错误

Without your code it's difficult to say. There is likely an error at your controller call. Check your quotes, maybe you put two quotes like this :

ng-controller=""mycontroller" <!-- error -->

or

ng-controller='my_controller" <!-- error -->

or simply a random character you may have written inadvertently on a random location of your file. In that case, and at the condition you developed your project using a version control system (git, svn) you can display your recent modification since your last commit by doing the command git(or svn) diff at the root of your project.

您可以在运行项目时看到错误详细信息

sails lift --silly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM