node.js - mac上的pug(jade)安装,报error

查看:206
本文介绍了node.js - mac上的pug(jade)安装,报error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

前提node事先已经安装成功:
$ node -v
v8.3.0

1.安装pug
$ npm install -g pug
结果:+ pug@2.0.0-rc.3
added 57 packages in 5.928s

2.检证pug
$ pug -v
结果:-bash: pug: command not found

3.安装pug cli
$ npm install pug-cli -g
结果:/usr/local/bin/pug -> /usr/local/lib/node_modules/pug-cli/index.js+ pug-cli@1.0.0-alpha6
added 68 packages in 4.894s

4.检证pug
$ pug -v
结果:error: unknown option `-v'

请问一下是命令行写错了还是安装步骤有问题,为什么不能检证成功?

解决方案

$ pug --version
pug version: 2.0.0-rc.3
pug-cli version: 1.0.0-alpha6


想看更多参数执行下面命令
pug --help

  Usage: pug [options] [dir|file ...]


  Options:

    -V, --version          output the version number
    -O, --obj <str|path>   JSON/JavaScript options object or file
    -o, --out <dir>        output the rendered HTML or compiled JavaScript to <dir>
    -p, --path <path>      filename used to resolve includes
    -b, --basedir <path>   path used as root directory to resolve absolute includes
    -P, --pretty           compile pretty HTML output
    -c, --client           compile function for client-side
    -n, --name <str>       the name of the compiled template (requires --client)
    -D, --no-debug         compile without debugging (smaller functions)
    -w, --watch            watch files for changes and automatically re-render
    -E, --extension <ext>  specify the output file extension
    -s, --silent           do not output logs
    --name-after-file      name the template after the last section of the file path (requires --client and overriden by --name)
    --doctype <str>        specify the doctype on the command line (useful if it is not specified by the template)
    -h, --help             output usage information

这篇关于node.js - mac上的pug(jade)安装,报error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆