takimo / twitter-bootstrap-node Goto Github PK
View Code? Open in Web Editor NEWTwitter Bootstrap for Node.js
Twitter Bootstrap for Node.js
Hi, I have just created and run a new project by calling node app.js
.
After I go to the site, it only return a page without CSS.
And the node process on the server is stop and shows
/home/ubuntu/new/app.js:38
parser.parse(str, function(err, root){fn(err, root.toCSS());});
^
TypeError: Cannot call method 'toCSS' of undefined
at /home/ubuntu/new/app.js:38:56
at Object.finish [as _finish] (/home/ubuntu/new/node_modules/less/lib/less/parser.js:475:21)
at Object.subFinish [as _finish] (/home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:56:47)
at Object.subFinish [as _finish] (/home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:56:47)
at Object.tree.importVisitor.run (/home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:25:22)
at /home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:63:34
at /home/ubuntu/new/node_modules/less/lib/less/parser.js:97:17
at /home/ubuntu/new/node_modules/less/lib/less/index.js:141:13
at finish (/home/ubuntu/new/node_modules/less/lib/less/parser.js:478:21)
at Object.Parser.parser.parse (/home/ubuntu/new/node_modules/less/lib/less/parser.js:486:17)
I have installed and added twitter-bootstrap-node and less-middleware.
Here is what I added to app.configure
app.use(require('less-middleware')({ src: __dirname + '/public' }));
I also have verified that less is compiling correctly.
How though do I wire it into layout?
doctype 5
html
head
title= title
// How do I link to bootstrap files?
link(rel='stylesheet', href='/css/bootstrap/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
I got 500 error code and following error infos
500 Error: /var/www/site/myblog/views/layout.jade:1 > 1| !!! 2| html 3| head 4| title= title !!!
is deprecated, you must now use doctype
1| !!!
2| html
3| head
4| title= title
!!!
is deprecated, you must now usedoctype
at Object.Lexer.doctype (/var/www/site/myblog/node_modules/jade/lib/lexer.js:249:13)
at Object.Lexer.next (/var/www/site/myblog/node_modules/jade/lib/lexer.js:846:15)
at Object.Lexer.lookahead (/var/www/site/myblog/node_modules/jade/lib/lexer.js:114:46)
at Parser.lookahead (/var/www/site/myblog/node_modules/jade/lib/parser.js:100:23)
at Parser.peek (/var/www/site/myblog/node_modules/jade/lib/parser.js:77:17)
at Parser.parse (/var/www/site/myblog/node_modules/jade/lib/parser.js:115:26)
at parse (/var/www/site/myblog/node_modules/jade/lib/jade.js:95:62)
at Object.exports.compile (/var/www/site/myblog/node_modules/jade/lib/jade.js:154:9)
at Function.exports.compile (/var/www/site/myblog/node_modules/express/lib/view.js:68:33)
at ServerResponse.res._render (/var/www/site/myblog/node_modules/express/lib/view.js:417:18)
I only install it, and run it, and then I get this error.
BTW, how can I uninstall? just remove the code from my project?
Thanks.
Hi there, first of all I'm running node.js on windows.
I've installed twitter-bootstrap from npmjs.org with
npm install twitter-bootstrap-node
and I've run it using
$ twitter-bootstrap project
$ cd project
$ npm install
$ node app.js
When I try to open the site on my browser i get the error;
H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap>node app.js
Express server listening on port 3000 in development mode
H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\app.js:38
parser.parse(str, function(err, root){fn(err, root.toCSS());});
^
TypeError: Cannot call method 'toCSS' of undefined
at H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\app.js:38:56
at Object.finish [as _finish] (H:\Coding\cointurk.net\tests\bootstrap\twitte
r-bootstrap\node_modules\less\lib\less\parser.js:538:28)
at Object.subFinish [as _finish] (H:\Coding\cointurk.net\tests\bootstrap\twi
tter-bootstrap\node_modules\less\lib\less\import-visitor.js:63:47)
at Object.subFinish [as _finish] (H:\Coding\cointurk.net\tests\bootstrap\twi
tter-bootstrap\node_modules\less\lib\less\import-visitor.js:63:47)
at Object.tree.importVisitor.run (H:\Coding\cointurk.net\tests\bootstrap\twi
tter-bootstrap\node_modules\less\lib\less\import-visitor.js:25:22)
at H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\node_modules\les
s\lib\less\import-visitor.js:72:38
at fileParsedFunc (H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\
node_modules\less\lib\less\parser.js:80:17)
at H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\node_modules\les
s\lib\less\parser.js:103:29
at finish (H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\node_mod
ules\less\lib\less\parser.js:541:28)
at Object.Parser.parser.parse (H:\Coding\cointurk.net\tests\bootstrap\twitte
r-bootstrap\node_modules\less\lib\less\parser.js:549:24)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.