aheckmann / node-ses

An Amazon SES api for nodejs with proper error handling.
http://aheckmann.github.com/node-ses
MIT License
200 stars 37 forks source link

Cannot find module 'xml2js' #29

Closed sahanDissanayake closed 8 years ago

sahanDissanayake commented 8 years ago

Hi there,

I'm trying to use this package with MeteorJS, I get the following error on the console

screen shot 2016-07-09 at 9 29 36 pm
sahanDissanayake commented 8 years ago

This is weird because on my terminal I can see xmljs has been installed to node_modules

$   meteor npm install --save node-ses
meteor-data-and-react@0.0.0 /Users/sahan/Apps/myapp
└─┬ node-ses@1.2.0 
  ├─┬ debug@2.2.0 
  │ └── ms@0.7.1 
  ├─┬ request@2.73.0 
  │ ├── aws-sign2@0.6.0 
  │ ├── aws4@1.4.1 
  │ ├─┬ bl@1.1.2 
  │ │ └─┬ readable-stream@2.0.6 
  │ │   ├── core-util-is@1.0.2 
  │ │   ├── inherits@2.0.1 
  │ │   ├── isarray@1.0.0 
  │ │   ├── process-nextick-args@1.0.7 
  │ │   ├── string_decoder@0.10.31 
  │ │   └── util-deprecate@1.0.2 
  │ ├── caseless@0.11.0 
  │ ├─┬ combined-stream@1.0.5 
  │ │ └── delayed-stream@1.0.0 
  │ ├── extend@3.0.0 
  │ ├── forever-agent@0.6.1 
  │ ├─┬ form-data@1.0.0-rc4 
  │ │ └── async@1.5.2 
  │ ├─┬ har-validator@2.0.6 
  │ │ ├─┬ chalk@1.1.3 
  │ │ │ ├── ansi-styles@2.2.1 
  │ │ │ ├── escape-string-regexp@1.0.5 
  │ │ │ ├─┬ has-ansi@2.0.0 
  │ │ │ │ └── ansi-regex@2.0.0 
  │ │ │ ├── strip-ansi@3.0.1 
  │ │ │ └── supports-color@2.0.0 
  │ │ ├─┬ commander@2.9.0 
  │ │ │ └── graceful-readlink@1.0.1 
  │ │ ├─┬ is-my-json-valid@2.13.1 
  │ │ │ ├── generate-function@2.0.0 
  │ │ │ ├─┬ generate-object-property@1.2.0 
  │ │ │ │ └── is-property@1.0.2 
  │ │ │ ├── jsonpointer@2.0.0 
  │ │ │ └── xtend@4.0.1 
  │ │ └─┬ pinkie-promise@2.0.1 
  │ │   └── pinkie@2.0.4 
  │ ├─┬ hawk@3.1.3 
  │ │ ├── boom@2.10.1 
  │ │ ├── cryptiles@2.0.5 
  │ │ ├── hoek@2.16.3 
  │ │ └── sntp@1.0.9 
  │ ├─┬ http-signature@1.1.1 
  │ │ ├── assert-plus@0.2.0 
  │ │ ├─┬ jsprim@1.3.0 
  │ │ │ ├── extsprintf@1.0.2 
  │ │ │ ├── json-schema@0.2.2 
  │ │ │ └── verror@1.3.6 
  │ │ └─┬ sshpk@1.8.3 
  │ │   ├── asn1@0.2.3 
  │ │   ├── assert-plus@1.0.0 
  │ │   ├─┬ dashdash@1.14.0 
  │ │   │ └── assert-plus@1.0.0 
  │ │   ├── ecc-jsbn@0.1.1 
  │ │   ├─┬ getpass@0.1.6 
  │ │   │ └── assert-plus@1.0.0 
  │ │   ├── jodid25519@1.0.2 
  │ │   ├── jsbn@0.1.0 
  │ │   └── tweetnacl@0.13.3 
  │ ├── is-typedarray@1.0.0 
  │ ├── isstream@0.1.2 
  │ ├── json-stringify-safe@5.0.1 
  │ ├─┬ mime-types@2.1.11 
  │ │ └── mime-db@1.23.0 
  │ ├── node-uuid@1.4.7 
  │ ├── oauth-sign@0.8.2 
  │ ├── qs@6.2.0 
  │ ├── stringstream@0.0.5 
  │ ├── tough-cookie@2.2.2 
  │ └── tunnel-agent@0.4.3 
  └─┬ xml2js@0.4.17 
    ├── sax@1.2.1 
    └─┬ xmlbuilder@4.2.1 
      └── lodash@4.13.1 
markstos commented 8 years ago

Isn't the first screenshot from a /browser/ ? But the second copy/paste is from your backend code?

It seems perhaps you installed this module for use by Node.js but also expected it to work directly in frontend code?

sahanDissanayake commented 8 years ago

1) Yes. it was on a browser.

Ahh make sense.. I will make sure the code only loads on the server 👍