Error: `doctype 5` is deprecated, you must now use `doctype html`: Node.js Express App bug solved

I am using Visual Studio to create Node.js application. I created a Node project by selecting Blank Express Application project template from JavaScript project type.

clip_image002

After creating project I pressed F5 to run application. On running application I got following error

clip_image003

Solving this error is very easy. From views folder in project open layout.jade. You will find below code

clip_image005

First line of code contains doctype 5. You need to replace it with doctype html

clip_image007

Now go ahead and press F5 to run application. You should not get above exception and in browser expected output you will get as below,

clip_image008

I hope you find this post useful. Thanks for reading.

Published by

Dhananjay Kumar

Dhananjay Kumar is Developer Evangelist for Infragistics. He is a 8 times Microsoft MVP and well respected Developer Advocate in India.He is the author of 900+ Blog Posts, and can often be found speaking around India at conferences and hosting free workshops for programmers across the country. So far, he has hosted 60 free workshops on various topics like JavaScript, Angular, WCF, ASP.NET MVC, C#, Azure etc. Follow him on twitter @debug_mode for all the updates about his blog posts and workshops. You can send him email at debugmode [at] outlook [dot] com

One thought on “Error: `doctype 5` is deprecated, you must now use `doctype html`: Node.js Express App bug solved”

  1. Pingback: TechNet Blogs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s