【问题标题】:Jade-cli - saving folder structure gives an errorJade-cli - 保存文件夹结构出错
【发布时间】:2016-11-28 16:12:44
【问题描述】:

我正在使用jade-cli 将我的项目从.jade 文件编译成.html。

Jade 文件具有以下层次结构:

components
  views
  templates
  ...

我希望渲染结果具有相同的文件夹结构并尝试使用-H 属性,正如此处文档中所述:https://www.npmjs.com/package/jade-cli

但是当我使用命令jade -P -H src -o dst npm 时返回以下错误:

silly lifecycle @~build: Args: [ '/d /s /c', 'jade -P -H src -o dst' ]
    12 silly lifecycle @~build: Returned: code: 1  signal: null
info lifecycle @~build: Failed to exec build script
verbose stack Error: @ build: `jade -P -H src -o dst`
verbose stack Exit status 1
verbose stack     at EventEmitter.<anonymous> (C:\Program     Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
verbose stack     at emitTwo (events.js:106:13)
 verbose stack     at EventEmitter.emit (events.js:191:7)
verbose stack     at ChildProcess.<anonymous> (C:\Program     Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
verbose stack     at emitTwo (events.js:106:13)
verbose stack     at ChildProcess.emit (events.js:191:7)
verbose stack     at maybeClose (internal/child_process.js:877:16)
verbose stack     at Process.ChildProcess._handle.onexit     (internal/child_process.js:226:5)
error Windows_NT 6.1.7601
error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program     Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
error node v6.9.1
error npm  v3.10.8
error code ELIFECYCLE
error @ build: `jade -P -H src -o dst`
error Exit status 1
error Failed at the @ build script 'jade -P -H src -o     dst'.
error Make sure you have the latest version of node.js and npm installed.
error If you do, this is most likely a problem with the  package,
error not with npm itself.
error Tell the author that this fails on your system:
error     jade -P -H src -o dst
error You can get information on how to open an issue for this project     with:
error     npm bugs
error Or if that isn't available, you can get their info via:
error     npm owner ls
error There is likely additional logging output above.
verbose exit [ 1, true ]

如果-H 被排除在外,一切正常。似乎是什么问题?

npm 版本:6.9.1 翡翠版:1.11.0

【问题讨论】:

    标签: node.js npm pug


    【解决方案1】:

    问题已解决。我的错误是我认为 jade-cli 是普通玉包的一部分。看来您必须使用单独安装它

    npm i jade-cli -g
    

    -g 用于全局安装。

    编译成功并创建所有必要的文件夹架构后

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-02
      • 1970-01-01
      • 1970-01-01
      • 2017-11-04
      • 2020-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多