node.js - Error: Could not find module `eventsource` imported from a route -


i'm having trouble importing node module ember-cli app. in notebook/route.js, have

import ember 'ember'; import eventsource 'eventsource'; 

i see other files importing other node modules 'ember-data' way. following in console when navigate route:

error: not find module `eventsource` imported `ui/notebooks/route` @ requirefrom (loader.js:110) @ reify (loader.js:97) @ mod.state (loader.js:140) @ tryfinally (loader.js:21) @ requiremodule (loader.js:139) @ ember.defaultresolver.extend._extractdefaultexport (ember-resolver.js:390) @ resolveother (ember-resolver.js:122) @ superwrapper (ember.debug.js:21571) @ exports.default._emberruntimesystemobject.default.extend.resolveroute (ember.debug.js:5014) @ exports.default._emberruntimesystemobject.default.extend.resolve (ember.debug.js:4847) 

i installed node module using npm install eventsource --save , generated following in package.json:

  "devdependencies": { "body-parser": "^1.14.1", "broccoli-asset-rev": "^2.1.2", "ember-cli": "1.13.8", "ember-cli-app-version": "1.0.0", "ember-cli-babel": "^5.1.3", "ember-cli-dependency-checker": "^1.0.1", "ember-cli-htmlbars": "1.0.1", "ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-ic-ajax": "0.2.1", "ember-cli-inject-live-reload": "^1.3.1", "ember-cli-qunit": "^1.0.0", "ember-cli-rails-addon": "0.0.12", "ember-cli-release": "0.2.3", "ember-cli-showdown": "2.5.0", "ember-cli-sri": "^1.0.3", "ember-cli-uglify": "^1.2.0", "ember-data": "2.1.0", "ember-disable-proxy-controllers": "^1.0.0", "ember-export-application-global": "^1.0.3", "express": "^4.13.3", "glob": "^4.5.3", "morgan": "^1.6.1", "nedb": "^1.2.1" }, "dependencies": {   "eventsource": "^0.1.6" } 

it seems valid node package, sourced here:

can shed light on this? new ember , node not javascript ... i'm rails developer.

thank you!

you can't import every npm module ember cli application because it's npm module.

you can use import keyword special npm packages - ember cli addons, expose public api application.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -