Electron register protocol not working - node.js

I am trying this:
https://electron.atom.io/docs/api/protocol/
And I get this error:
https://google.com/#q=standard%2Fno-callback-literal Unexpected literal in error position of callback
Why is it not working?

Solution is to install this so the callback can work:
https://github.com/xjamundx/eslint-plugin-standard

Related

mangopay intergation in node js. Could not create user

I am integrating mangopay in node js and I am using npm for mangopay2-nodejs-sdk.but when I use api.Users.create function for creating user ,it gives me error
Debug: internal, implementation, error
TypeError: Uncaught error: Cannot read property 'userClass' of undefined
at Service.extend.create (/home/hashir/artpaie/artapieapp/artapieBackend/node_modules/mangopay2-nodejs-sdk/lib/services/Users.js:38:41)
The error handler in _getUserApiAndClass method seems not to be working, my problem was that I didn't have specified the PersonType.
It is uppercase
Natural: 'NATURAL'
Legal: 'LEGAL'

TypeError when generating angular-fullstack service?

I'm receiving the following TypeError when trying to generate an angular-fullstack service.
Does anyone know why this is happening?
Here is my terminal window:
Justins-MacBook-Pro-2:epbWebApp Justin$ yo angular-fullstack:service
? What module name would you like to use? epbWebAppApp.event
? Where would you like to create this service? event
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1213:7)
at /Users/Justin/npm/lib/node_modules/generator-angular-fullstack/node_modules/generator-ng-component/service/index.js:28:21
DUH! I re-read the documentation and I simply forgot that you must specify a name for the service in the initial command.
I typed the first command as follows, and it worked!
yo angular-fullstack:service [NAME]
Then I was able to specify module name and location in the following two prompts.

nodejs http.getagent on v0.10.6 can't work

I'm a newbie to nodejs ,recently i tried upgrade nodejs from 0.4.7 to 0.10.6,but my app.js got a error message ,
"http.getAgent: TypeError: Object# has no method 'getAgent' "
then checked codes from app.js found
" var somevar = http.getAgent('somedomain' , 80 ); "
so which class or method can replace getAgent with 0.10.6 ?
Thanks a lot !
I actually can't find any information on the removal of getAgent -- even in the changelog. It seems that you would only need to use the http agent for hyper-technical reasons. If you really need to use the agent, it seems that you can use http.globalAgent (property, not function) instead.

Geddy/NodeJS scaffold error

I'm new into node.js and i chose geddy to start one sample app.
I tried to execute this command:
geddy scaffold news title:string
but when I run the application, i received an error
Error: 500 Internal Server Error
TypeError: ejs:11
<%- linkTo(news[i].title, newsPath(news[i].id)); %>
string is not a function
at handleErr (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:58:15)
at Object.rethrow (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:90:41)
at eval (eval at (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:88:10), :2:925)
at C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:101:17
at ejs.render (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\adapters\ejs.js:28:10)
at Adapter.render (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\adapters\index.js:122:22)
at Partial.renderSelf (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\partial.js:128:28)
at handleData (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\partial.js:101:16)
at C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\partial.js:119:9
at fs.js:266:14
i think that this error is happening by the singular/plural problem,
because when i removed the call to "newsPath", this worked.
Anyone know how to make it work?

node.js send object from server to client console for debugging

How can I pass an object from server to client make it looking like this in the console?
I tried to use util.inspect(myObject, {showHidden: false, depth: null}),
but it returns a string and I cannot fold/unfold it in the console:
I tried to convert it to an object using var obj = JSON.parse(str);, but it gives me an error:
Uncaught SyntaxError: Unexpected token S in JSON at position 0
or var obj=eval("("+str+")");, but it gives me an error:
Uncaught SyntaxError: Unexpected token {
If you are using devtool or node monkey to connect node.js to your console, then you can simply use:
console.log(myObject);
Or for a more detailed view:
console.dir(myObject);
Node Inspector seems to have (had?) some issues with console ouput.
If you wish to log to stderr instead of stdout you can use:
console.error('%o',myObject)

Resources