nodejs-connect-rest-sample icon indicating copy to clipboard operation
nodejs-connect-rest-sample copied to clipboard

sendMail Function seem not working

Open joeychaisri opened this issue 9 years ago • 7 comments

I can login through the first step here it is

Hi, PATHOMPONG CHAISRI (GABLE-NBP-EM)!

You're now connected to Microsoft Graph. Click the button below to send a message from your account using the Microsoft Graph API.

but when I try to send an email it's say

This page isn’t working

localhost didn’t send any data.

screen shot 2560-06-08 at 10 28 35 am screen shot 2560-06-08 at 10 36 08 am

here is my log

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle [email protected]~prestart: [email protected] 6 silly lifecycle [email protected]~prestart: no script for prestart, continuing 7 info lifecycle [email protected]~start: [email protected] 8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true 9 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/st4rboy/Desktop/Intern/nodejs-connect-rest-sample-master/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 10 verbose lifecycle [email protected]~start: CWD: /Users/st4rboy/Desktop/Intern/nodejs-connect-rest-sample-master 11 silly lifecycle [email protected]~start: Args: [ '-c', 'mocha ./tests/confTest.js && node ./bin/www' ] 12 silly lifecycle [email protected]~start: Returned: code: 1 signal: null 13 info lifecycle [email protected]~start: Failed to exec start script 14 verbose stack Error: [email protected] start: mocha ./tests/confTest.js && node ./bin/www 14 verbose stack Exit status 1 14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:886:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 15 verbose pkgid [email protected] 16 verbose cwd /Users/st4rboy/Desktop/Intern/nodejs-connect-rest-sample-master 17 error Darwin 16.6.0 18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 19 error node v6.10.3 20 error npm v3.10.10 21 error code ELIFECYCLE 22 error [email protected] start: mocha ./tests/confTest.js && node ./bin/www 22 error Exit status 1 23 error Failed at the [email protected] start script 'mocha ./tests/confTest.js && node ./bin/www'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the nodejs-microsoft-graph-connect package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error mocha ./tests/confTest.js && node ./bin/www 23 error You can get information on how to open an issue for this project with: 23 error npm bugs nodejs-microsoft-graph-connect 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls nodejs-microsoft-graph-connect 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ]

joeychaisri avatar Jun 08 '17 03:06 joeychaisri

Thanks for reporting this. Does your account have a profile photo? If not, then this is another instance of a known issue.

jamescro avatar Jun 09 '17 18:06 jamescro

My account have a profile picture @jamescro

joeychaisri avatar Jun 13 '17 03:06 joeychaisri

Are you using a consumer (hotmail or live.com) account?

jamescro avatar Jun 13 '17 16:06 jamescro

@jamescro It seems many people are having similar issue. We all tried consumer account w/ profile picture. Here is my log with some information redacted for privacy:

[email protected] start /home/jack/nodejs-connect-rest-sample-master mocha ./tests/confTest.js && node ./bin/www

ADAL ✓ Checking clientID and clientSecret in config.js

1 passing (9ms)

{"name":"AzureAD: OIDC Passport Strategy","hostname":"XXXX","pid":11643,"level":40,"msg":"Production environments should always validate the issuer.","time":"2017-06-23T14:47:13.196Z","v":0} {"name":"AzureAD: OIDC Passport Strategy","hostname":"XXXX","pid":11643,"level":40,"msg":"Using http for redirectUrl is not recommended, please consider using https","time":"2017-06-23T14:47:13.204Z","v":0}

Listening on port 3000 GET /sendMail 404 14.663 ms - 1349 Error: Not Found at /home/jack/nodejs-connect-rest-sample-master/app.js:80:15 at Layer.handle [as handle_request] (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:317:13) at /home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:335:12) at next (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:275:10) at /home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:635:15 at next (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:260:14) at Function.handle (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:174:3) at router (/home/jack/nodejs-connect-rest-sample-master/node_modules/express/lib/router/index.js:47:12) GET / 304 115.812 ms - - GET /stylesheets/style.css 304 7.309 ms - - GET /login 302 541.363 ms - 0 GET /token?code=Mf7092cf2-1467-0785-e000-3fc410d8b68f&state=D6THcPDiaRB44e4gbP1Be8O6AyTbUgyF 200 1385.728 ms - 2007 GET /stylesheets/style.css 304 4.681 ms - - /home/jack/nodejs-connect-rest-sample-master/routes/index.js:139 res.render('error', { ^

TypeError: Cannot read property 'render' of undefined at renderError (/home/jack/nodejs-connect-rest-sample-master/routes/index.js:139:6) at graphHelper.getProfilePhoto (/home/jack/nodejs-connect-rest-sample-master/routes/index.js:73:19) at request.get.set.end (/home/jack/nodejs-connect-rest-sample-master/utils/graphHelper.js:35:6) at Request.callback (/home/jack/nodejs-connect-rest-sample-master/node_modules/superagent/lib/node/index.js:688:3) at /home/jack/nodejs-connect-rest-sample-master/node_modules/superagent/lib/node/index.js:883:18 at IncomingMessage. (/home/jack/nodejs-connect-rest-sample-master/node_modules/superagent/lib/node/parsers/json.js:16:7) at emitNone (events.js:110:20) at IncomingMessage.emit (events.js:207:7) at endReadableNT (_stream_readable.js:1047:12) at _combinedTickCallback (internal/process/next_tick.js:102:11) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: mocha ./tests/confTest.js && node ./bin/www npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script.

jackluo923 avatar Jun 23 '17 14:06 jackluo923

We just checked in a number of changes, including one that should make consumer account profile pictures accessible. Could you try again with the latest version of the repo?

jamescro avatar Jul 06 '17 17:07 jamescro

This should be working with recent changes. Closing.

jamescro avatar Sep 01 '17 22:09 jamescro

Encountered this issue again with the latest changes.

twisstosin avatar Jun 14 '18 21:06 twisstosin