1
votes

I have googled and found many solutions but none work for me. I am using ionic2/cordova. Everything is installed properly: cordova, pug, pug-cli, ant, sdk, jdk.

Full Error Message:

    'pug' is not recognized as an internal or external command,
     operable program or batch file.
     npm ERR! Windows_NT 6.3.9600 npm ERR! argv 
    "C:\\Program Files(x86)\\Nodist\\v\\nodev6.7.0\\node.exe" 
    "C:\\Program Files (x86)\\Nodist  \\bin\\node_modules\\npm\\bin\\npmcli.js" "run" "pug" npm 
    ERR! node v6.7.0 npm ERR! npm  v2.14.10 npm ERR! code ELIFECYCLE npmERR! Iwatch@ pug: `pug src/` npm ERR! Exit status 1 Full Error Message:

2
update your node to the last lts version v6.11.0 and then install ionic "npm install -g ionic cordova" - Ramon Marques
I have updated node to latest version and install "npm install -g ionic cordova" too but now I get this error: Sorry, there's a problem with nodist. Couldn't resolve version spec %s: %s nodev8.1.0 Unexpected character in constraint nodev8.1.0: node - Ali Mossavi
last version is not good, my advice is last lts version, which is v6.11.0 not 8.1 - Ramon Marques
I switched to this version of node v6.11.0 but still I get the nodist error anything else please? - Ali Mossavi

2 Answers

1
votes

For those having a problem with this on Linux distros in 2020, and are lead here by Google because pug isn't downloading...

"pug" no longer is a thing; it is now "pug-cli". Install this with the usual npm package.

npm install pug-cli -g

0
votes

I had the same problem, searched for a solution and found this one it worked for me

For those searching to a solution for this but have already installed pug-cli, try specifying the version on installation. For example, npm install [email protected] -g For some reason by default npm was installing version 0.0.0