sendrid에서 다음 문서를 사용하여 이메일을 보내려고합니다.
https://sendgrid.com/docs/Integrate/Code_Examples/v2_Mail/nodejs.html
내 app.js는 다음과 같습니다.
var sendgrid = require('sendgrid')('SENDGRID_APIKEY');
npm start를 실행하면 다음 오류가 발생합니다.
var sendgrid = require('sendgrid')(conf);
^
TypeError: require(...) is not a function
at Object.<anonymous> (C:\Users\Grandullon\Desktop\angular\app.js:8:36)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\Grandullon\Desktop\angular\bin\www:7:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
내가 뭘 잘못하고 있는지 아이디어가 있습니까? conf는 API 키를 저장하는 변수입니다.
깨끗한 빠른 설치를 사용하고 있습니다.
감사
내 package.json은 요청에 따라 여기에서 볼 수 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다