I'm using jade-cli to compile my project from .jade files into .html.
Jade files have following hierarchy:
components
views
templates
...
I want rendered result to have same folder structure and trying to use -H
attribute as it is said in documentation here: https://www.npmjs.com/package/jade-cli
However when I'm using command jade -P -H src -o dst
npm returns following error:
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 ]
If -H
is excluded everything runs fine. What seems to be the problem?
npm version: 6.9.1 jade version: 1.11.0
Issue has been resolved. My mistake was that I thought jade-cli was part of common jade package. Appears that you have to install it separately using
npm i jade-cli -g
-g
for installing it globally.
After this compilation goes successfully and creates all necessary folder architecture
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.