Desidero utilizzare bootstrap per il mio sito Web (con node.js). Ma ho il seguente errore:jQuery non definito nel modulo bootstrap
/var/www/node_modules/bootstrap/js/transition.js:59 }(jQuery); ^ ReferenceError: jQuery is not defined at Object. (/var/www/node_modules/bootstrap/js/transition.js:59:3) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/var/www/node_modules/bootstrap/dist/js/npm.js:2:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10)
ho cercato di fare un
var bootstrap = require('bootstrap');
nel mio nodo principale.
Ho installato bootstrap con npm (npm install bootstrap
dalla mia cartella). Ho anche provato ad installare jquery allo stesso modo e aggiungere uno var jQuery= require('jquery');
ma non funziona. Hai idea di cosa potrebbe essere sbagliato? Sto iniziando node.js, potrei perdere qualcosa
allora io uso <link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
nella mia pagina web HTML per riferirsi a bootstrap `
si fa a caricare jQuery prima di bootstrap? – Michelangelo
sì, faccio un 'var jQuery = require ('jquery'); var bootstrap = require ('bootstrap'); ' – LLenain