Unable to lift the sails.js app - node.js

I am unable to run my sails.js app. When I tried sails lift, it throws the following error. Is there anything else need to be done?
C:\my_project_path\config\._blueprints.js:1
(function (exports, require, module, __filename, __dirname) {
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\include-all\index.js:129:29
at Array.forEach (native)
at requireAll (C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\include-all\index.js:44:9)
at buildDictionary (C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node
_modules\sails\node_modules\sails-build-dictionary\index.js:68:14)
at Function.module.exports.aggregate (C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\sails\node_modules\sails-build-dictionary\index.js:190:9)
at Array.loadOtherConfigFiles [as 0] (C:\Users\Raghav Mac\Desktop\FiZZ\web-s
ervice-master\node_modules\sails\lib\hooks\moduleloader\index.js:164:27)
at C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\sails\node_modules\async\lib\async.js:484:38
at _each (C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\sails\node_modules\async\lib\async.js:46:13)
at Object.async.auto (C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\sails\node_modules\async\lib\async.js:455:9)
at Hook.loadUserConfig (C:\Users\Raghav Mac\Desktop\FiZZ\web-service-master\node_modules\sails\lib\hooks\moduleloader\index.js:160:13)
Need help with this, thanks in advance.

Thanks to Adam William Larson for the answer.
Upgrade to node v0.11.. that might fix the issue, i'm pretty certain the latest version of sails only works with v0.11 or later.

Related

nodemon or nodemon index.js not working on ubuntu 16.04

I am trying to run my server automatically after every push, do not want to restart every time on ubuntu instance 16.04
/usr/local/lib/node_modules/nodemon/lib/monitor/run.js:356
let sig = signal.replace('SIG', '');
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
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 Object.<anonymous> (/usr/local/lib/node_modules/nodemon/lib/monitor/index.js:2:8)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
having this error, can anyone tell what is the problem?
Thanks budy #developerKumar and sorry for late reply.
you gave me a hint I simply upgrade my node version and its working.

throw new TypeError('The super constructor to "inherits" must not ' +

I am trying to build my nodejs application. but i am always getting this error.
util.js:988
throw new TypeError('The super constructor to "inherits" must not ' +
^
TypeError: The super constructor to "inherits" must not be null or undefined
at Object.inherits (util.js:988:11)
at Object.<anonymous> (D:\CIDE-Backend\CIDE-BACKEND\node_modules\zetta\node_modules\spdy\lib\spdy\connection.js:86:6)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\CIDE-Backend\CIDE-BACKEND\node_modules\zetta\node_modules\spdy\lib\spdy.js:20:19)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
[nodemon] app crashed - waiting for file changes before starting...
i followed this solution but still i am getting same error.
my node version is 8.4.0
my npm version is 5.5.1
Can you tell me how can i solve this error.?
Your dependency zetta is including an ancient version of spdy which is not compatible with you current version of Node. There is currently an open issue on zetta's github about this, which has a work around:
process.EventEmitter = require('events').EventEmitter
const zetta = require('zetta')
Your mileage may vary on that hack, I have not tested it myself. Alternatively, you could wait for the zetta team to fix their dependency or downgrade your node installation.

Sails generate-oauth

I following this link sails-generate-oauth to generate oauth with sails, i follow and make all steps as in the refered page say but i am getting this error:
root#Ubuntu:~/sailTests/guatour# sails lift
info: Starting app...
/root/sailTests/guatour/config/routes.js:50
'get /login': 'AuthController.login',
^^^^^^^^^^^^
SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /usr/local/lib/node_modules/sails/node_modules/include- all/index.js:129:29
at Array.forEach (native)
at requireAll (/usr/local/lib/node_modules/sails/node_modules/include-all/index.js:44:9)
at buildDictionary (/root/sailTests/guatour/node_modules/sails/node_modules/sails-build-dictionary/index.js:68:14)
at Function.module.exports.aggregate (/root/sailTests/guatour/node_modules/sails/node_modules/sails-build-dictionary/index.js:190:9)
at Array.loadOtherConfigFiles (/root/sailTests/guatour/node_modules/sails/lib/hooks/moduleloader/index.js:164:27)
at /root/sailTests/guatour/node_modules/sails/node_modules/async/lib/async.js:484:38
at _each (/root/sailTests/guatour/node_modules/sails/node_modules/async/lib/async.js:46:13)
at Object.async.auto (/root/sailTests/guatour/node_modules/sails/node_modules/async/lib/async.js:455:9)
Am i missing something?
Thanks for your help, regards.
Sorry, i found my error, it was a coma, before the (/) route (default).

upgraded node to v0.8 and started receiving an error for sys/util

I upgraded from node v0.6.12 to 0.80 and started receiving the error below - I have removed the sys module from the import but am still getting the error. Any helpful hints would be helpful. I am not suing stylus either.
path.exists is now called `fs.exists`.
sys.js:1
throw new Error(
Error: The "sys" module is now called "util".
at sys.js:1:69
at NativeModule.compile (node.js:602:5)
at Function.NativeModule.require (node.js:570:18)
at Function.Module._load (module.js:297:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/node/node_modules/stylus/lib/token.js:12:15)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
Upgrade to node v0.8.1. It will solve your problem

unexpected token <

Using the nodejs v.6.7 with faye v.7.1 I am getting error
/path/livestats/node_modules/faye0.7/faye.js:18
ID_LENGTH: <%= Faye::ID_LENGTH %>,
^
-----------------------
Exception: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Module._compile (module.js:427:25)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/path/livestats/lib/livestats.js:4:12)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
-----------------------
I am trying to implement example showing in peepcode's Meet node.js video.
Seems like you requiring faye.js as is before building faye_node.
You need to follow instructions on faye repository or installing it via npm:
npm install faye -d
If you install it via NPM you can require("faye-node")

Resources