javascript - Requiring module with karma not working -
i create dev javascript environment using tdd using node, jake, karma, chai , browserify. works fine, tests run green. want use raphael draw svgs. installed raphael npm install raphael
local node environment (not globally). requiring
var raphael = require("node-raphael")
whenever require in app.js
file, throws error:
uncaught error: not find module 'raphael' '../project/src/javascript/app.js'
just testing required in jakefile in project directory. there, requiring works fine. using raphael functions not work.
node modules placed in project dir. "project/node-modules/raphael"
i haven't used raphael
, looking @ npmjs.com there 2 different modules: raphael
, node-raphael
. have installed raphael
, requiring node-raphael
. so, either need install node-raphael
:
npm install node-raphael
or require raphael
in code:
var raphael = require("raphael")
see https://www.npmjs.com/package/raphael , https://www.npmjs.com/package/node-raphael.
Comments
Post a Comment