Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx failed with "22 verbose stack Error: command failed" #499

Closed
Abe2021 opened this issue Jan 10, 2021 · 2 comments · Fixed by #501
Closed

npx failed with "22 verbose stack Error: command failed" #499

Abe2021 opened this issue Jan 10, 2021 · 2 comments · Fixed by #501
Assignees
Labels
bug Something isn't working released

Comments

@Abe2021
Copy link

Abe2021 commented Jan 10, 2021

Just tried for the first time to use this library and ran the very first command:
npx pwa-asset-generator

but got the following output:

Automates PWA asset generation and image declaration. Automatically generates icon and splash screen images, favicons and mstile images. Updates manifest.json and index.html files with the generated images according to Web App Manifest specs and Apple Human Interface guidelines.

  $ pwa-asset-generator --help

    Usage
      $ pwa-asset-generator [source-file] [output-folder]

      The assets will be saved to the folder where the command is executed if no output-folder provided.

    Options
      -b --background             Page background to use when image source is provided: css value  [default: transparent]
      -o --opaque                 Shows white as canvas background and generates images without transparency  [default: true]
      -p --padding                Padding to use when image source provided: css value  [default: "10%"]
      -s --scrape                 Scraping Apple Human Interface guidelines to fetch splash screen specs  [default: true]
      -m --manifest               Web app manifest file path to automatically update manifest file with the generated icons
      -i --index                  Index HTML file path to automatically put splash screen and icon meta tags in
      -a --path                   Path prefix to prepend for href links generated for meta tags
      -v --path-override          Override the path of images used in href/src tags of manifest and HTML files
      -t --type                   Image type: png|jpg  [default: jpg - with the exception of manifest files]
      -q --quality                Image quality: 0...100 (Only for JPG)  [default: 70]
      -h --splash-only            Only generate splash screens  [default: false]
      -c --icon-only              Only generate icons  [default: false]
      -f --favicon                Generate favicon image and HTML meta tag  [default: false]
      -w --mstile                 Generate Windows static tile icons and HTML meta tags  [default: false]
      -e --maskable               Declare icons in manifest file as maskable icons  [default: true]
      -l --landscape-only         Only generate landscape splash screens  [default: false]
      -r --portrait-only          Only generate portrait splash screens  [default: false]
      -d --dark-mode              Generate iOS splash screen meta with (prefers-color-scheme: dark) media attr  [default: false]
      -u --single-quotes          Generate HTML meta tags with single quotes  [default: false]
      -x --xhtml                  Generate HTML meta tags by self-closing the tags  [default: false]
      -g --log                    Logs the steps of the library process  [default: true]
      -n --no-sandbox             Disable sandbox on bundled Chromium on Linux platforms - not recommended  [default: false]

    Examples
      $ pwa-asset-generator logo.html
      $ pwa-asset-generator logo.svg -i ./index.html -m ./manifest.json
      $ pwa-asset-generator https://your-cdn-server.com/assets/logo.png ./ -t jpg -q 90 --splash-only --portrait-only
      $ pwa-asset-generator logo.svg ./assets --splash-only --xhtml --single-quotes
      $ pwa-asset-generator logo.svg ./assets --scrape false --icon-only --path "%PUBLIC_URL%"
      $ pwa-asset-generator logo.svg ./assets --icon-only --favicon --opaque false --maskable false --type png
      $ pwa-asset-generator logo.svg ./assets --dark-mode --background dimgrey --splash-only --quality 80
      $ pwa-asset-generator logo.svg ./assets --padding "calc(50vh - 5%) calc(50vw - 10%)" --path-override "./your-custom-image-folder-path"
      $ pwa-asset-generator https://onderceylan.github.io/pwa-asset-generator/static/logo.png ./temp -p "15%" -b "linear-gradient(to right, #fa709a 0%, #fee140 100%)"
      $ pwa-asset-generator https://onderceylan.github.io/pwa-asset-generator/static/blm.png ./blm -p "15%" -b "linear-gradient(to right top, #d16ba5, #c777b9, #ba83ca, #aa8fd8, #9a9ae1, #8aa7ec, #79b3f4, #69bff8, #52cffe, #41dfff, #46eefa, #5ffbf1)"

    Flag examples
      --background "rgba(255, 255, 255, .5)"
      --opaque false
      --padding "10px"
      --scrape false
      --manifest ./src/manifest.json
      --index ./src/index.html
      --path "%PUBLIC_URL%"
      --path-override "./your-custom-image-folder-path"
      --type jpg
      --quality 80
      --splash-only
      --icon-only
      --favicon
      --mstile
      --maskable false
      --landscape-only
      --portrait-only
      --dark-mode
      --single-quotes
      --xhtml
      --log false

npm ERR! code 2
npm ERR! path C:\wamp64\www\myPWA
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c pwa-asset-generator

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxx.yyyyy\AppData\Local\npm-cache\_logs\2021-01-10T17_05_18_686Z-debug.log

The _logs file reads:

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'exec',
0 verbose cli   '--',
0 verbose cli   'pwa-asset-generator'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:C:\wamp64\www\myPWA\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\xxxx.yyyyy\.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\xxxx.yyyyy\AppData\Roaming\npm\etc\npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 8ms
19 verbose npm-session 31fd55ae6f26ce2f
20 timing npm:load Completed in 18ms
21 timing command:exec Completed in 665ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
22 verbose stack     at ChildProcess.emit (node:events:376:20)
22 verbose stack     at maybeClose (node:internal/child_process:1063:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
23 verbose cwd C:\wamp64\www\myPWA
24 verbose Windows_NT 10.0.19041
25 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "exec" "--" "pwa-asset-generator"
26 verbose node v15.4.0
27 verbose npm  v7.0.15
28 error code 2
29 error path C:\wamp64\www\myPWA
30 error command failed
31 error command C:\WINDOWS\system32\cmd.exe /d /s /c pwa-asset-generator
32 verbose exit 2

System

  • OS: Windows10 Pro, 64bit
  • node version: v15.4.0
  • npm version: 7.0.15
  • cli version: 4.1.0
@Abe2021 Abe2021 added bug Something isn't working needs verification Bug needs to be verified with reproduction labels Jan 10, 2021
@onderceylan onderceylan removed the needs verification Bug needs to be verified with reproduction label Jan 12, 2021
@onderceylan
Copy link
Collaborator

Hi @Abe2021, thank you for reporting this issue. I found the root cause and I will publish a fix soon.

@onderceylan onderceylan self-assigned this Jan 12, 2021
onderceylan added a commit that referenced this issue Jan 13, 2021
Do not throw when CLI executable is ran without providing any arguments.

fix #499
onderceylan added a commit that referenced this issue Jan 13, 2021
Do not throw when CLI executable is ran without providing any arguments.

fix #499
onderceylan pushed a commit that referenced this issue Jan 13, 2021
## [4.1.1](v4.1.0...v4.1.1) (2021-01-13)

### Bug Fixes

* **cli:** do not throw when args are missing ([53608e7](53608e7)), closes [#499](#499)
@onderceylan
Copy link
Collaborator

🎉 This issue has been resolved in version 4.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants