I have installed the jscrollpane node module:
$npm install --save-dev jscrollpane
I have also installed ember-browserify, so that I can import npm modules into my ember components, as per this article.
I import the module into my component:
import Jscrollpane from 'npm:jscrollpane';
The module is found, but I get this error:
Error: Cannot find module 'jquery' from '/Users/username/my-app/node_modules/jscrollpane/script'
I have read this article which suggests adding jQuery to the relevant npm module (In this case my-app/node_modules/jscrollpane/script.).
It seems undesirable to add an additional copy of jQuery to a node module directory- is there a better way of making node modules aware of where to find the core Ember cli version of it?
Aucun commentaire:
Enregistrer un commentaire