Sails generate-oauth - node.js

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).

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.

npm run dev undefined:1 issue on debian

undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Manifest.read (/var/www/html/app/node_modules/laravel-mix/src/Manife st.js:132:21)
at new Manifest (/var/www/html/app/node_modules/laravel-mix/src/Manifes t.js:14:43)
at Mix.initialize (/var/www/html/app/node_modules/laravel-mix/src/Mix.j s:49:25)
at Object.<anonymous> (/var/www/html/app/node_modules/laravel-mix/setup /webpack.config.js:18:5)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at requireConfig (/var/www/html/app/node_modules/webpack/bin/convert-ar gv.js:96:18)
at /var/www/html/app/node_modules/webpack/bin/convert-argv.js:109:17
at Array.forEach (native)
at module.exports (/var/www/html/app/node_modules/webpack/bin/convert-a rgv.js:107:15)
I'm using webpack with laravel, but i keep getting this error,I dont have any idea where to look for this issue or what could be the problem.
Any tips?
Thanks!
Try deleting the mix-manifest.json file from /public
From https://github.com/JeffreyWay/laravel-mix/issues/772
The Error is from JSON parser. Generally speaking, it is caused by pass wrong parameter to JSON.parse. Double check if you are trying to parse some improper string to JSON. I used to have this error when I passed a normal string to JSON parser.

Node.js SteamBot not working

my Node.js Steam-Bot isnt working. When i try starting him it always gives a Syntax Error:
/root/bot/node_modules/steam-tradeoffer-manager/lib/index.js:3
const SteamCommunity = require('steamcommunity');
^^^^^
SyntaxError: Use of const in strict mode.
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 Object.<anonymous> (/root/bot/tradebot.js:20:25)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Iam using Debian 8, Node Version 0.12.
Thank you!
The error says it all. Replace const with var.
Also, you should update your nodeJS version as mentioned in the comments. This is really important.

Unable to lift the sails.js app

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.

Code of nodejs using mongoose works on local machine but on VPS it doen't

This works on windows 7 localhost:
var User = mongoose.model(userDBName, userSchema);
But it gives this error for Debian VPS:
/home/node_modules/mongoose/lib/utils.js:28
return pluralize(name.toLowerCase());
^
TypeError: Cannot call method 'toLowerCase' of undefined
at exports.toCollectionName (/home/node_modules/mongoose/lib/utils.js:28:25)
at Mongoose.model (/home/node_modules/mongoose/lib/index.js:361:46)
at Object.<anonymous> (/home/XXX/nodejs/js/dbbase.js:54:21)
at Module._compile (module.js:456:26)
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 Object.<anonymous> (/home/XXX/nodejs/js/db_read.js:1:76)
How to fix it?
The error was the name is really undefined, due to userDBName is undefined. It relative with 'nconf' and config.json. Just incorrect way to this file.

Resources