the gulp-pug doesn't work and say unexpected token "indent"

25 views Asked by At

the gulp-pug doesn't work and say unexpected token "indent"

see the images below

gulp code and nodejs command prompt

index.pug and nodejs command prompt

package.json and nodejs command prompt

i use gulp v3.9.1 and node v8.11.3 and npm v6.9.0

i use this version because the course i watch use it and the new versions of gulp and node and npm is only work with ECMAScript6 and even if i use the lastest versions of gulp and node and npm and try to use ECMAScript 6 i get the same problem .

1

There are 1 answers

0
AKX On

As the error message implies, head etc. shouldn't be indented, they should be on the same level as doctype html (which makes sense, since the doctype tag doesn't hold the rest of the document).

doctype html
head
  meta(charset='UTF-8')
  title This Is Pugjs Page
body
  .container This Is Container

is correct.