NPM : Unexpected end of JSON input while parsing near


I got this error when trying to install npm-check-updates with npm 5.6.0 on node 8.1.1

The solution is simple, just invoke

npm cache clean --force

try install npm-check-updates again, voila! it works

source:

https://github.com/npm/npm/issues/19072

Advertisements

Pug render variable twice


recently, I want to pass this variable to the view

passedVars.metaOgUrl = '<meta property="og:url" content="' + originalUrl + '">';

and use the usual way of rendering variable in pug

#{metaOgUrl}

but it render the tag twice, a simple googling then found the answer, use != character as prefix

!=metaOgUrl

it’s rendered normal now

 

source:

https://stackoverflow.com/questions/23076881/jade-renders-my-html-twice