I'm new to node and npm and express.js still learning.
on bootstrap website its you can use bootstrap using npm install
, and I did the same installed bootstrap using npm install bootstrap --save
,
did that for jquery too and required in app.js
app.js file
var jQuery = require('jquery');
var bootstrap = require('bootstrap');
Changed it to this too
global.jQuery = require('jquery');
var bootstrap = require('bootstrap');
var jQuery = require('jquery'); var bootstrap = require('bootstrap');
but when i run DEBUG=nodeAangularMySql:* ./bin/www
I get the following errors.
/home/sharif/Sites/node/nodeAangularMySql/node_modules/bootstrap/js/transition.js:59
}(jQuery);
^
ReferenceError: jQuery is not defined
at Object.<anonymous> (/home/sharif/Sites/node/nodeAangularMySql/node_modules/bootstrap/js/transition.js:59:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/home/sharif/Sites/node/nodeAangularMySql/node_modules/bootstrap/dist/js/npm.js:2:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
This my very first time using bootstrap that way usually I download and copied that in stylesheets folder under public folder or Google CDN.
never used that before. I would like to know few thisn
- How to use bootstrap using npm install
- How to use jquery using npm install
- and how to fix this error
Any Idea?