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

Can't find yargs #27

Open
zach-is-my-name opened this issue Dec 5, 2021 · 3 comments
Open

Can't find yargs #27

zach-is-my-name opened this issue Dec 5, 2021 · 3 comments

Comments

@zach-is-my-name
Copy link

Error: Cannot find module 'yargs'
Require stack:
- /usr/lib/node_modules/ascii-art/bin/ascii-art
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/lib/node_modules/ascii-art/bin/ascii-art:3:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/lib/node_modules/ascii-art/bin/ascii-art' ]
@khrome
Copy link
Owner

khrome commented Feb 12, 2022

Yargs has been pulled as a core dependency, due to security warnings... thus you cannot currently install -g.

I will update the docs shortly... for now just use the experimental CL with npm install -g ascii-art-cl which will be the mainline for commandline use going forward.

@karen-pal
Copy link

karen-pal commented Apr 11, 2022

Hello @khrome ! I'm interested in using your library and possibly contributing to it. The images on the readme look really good!

Installing like you said on the comment of this thread

npm install -g ascii-art-cl

and trying the readme examples yields another error

me@computer:~/$ ascii-art image -B 32 -a solid ./escher.jpeg 
logging conf:
[String: '{\n' +
  '    // defaults go here.\n' +
  '    "bitdepth": 2,\n' +
  '    //request-as-request, fetch-as-request, axios-as-request\n' +
  '    "requestlib": "request-as-request",\n' +
  '    "artwork": []\n' +
  '}']
/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/bin/ascii-art:250
                    conf.artwork.forEach(function(source){
                                 ^

TypeError: Cannot read properties of undefined (reading 'forEach')
    at /home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/bin/ascii-art:250:34
    at done (/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:508:16)
    at CLApp.plugins (/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:513:10)
    at /home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/bin/ascii-art:240:21
    at /home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:365:9
    at Timeout._onTimeout (/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:305:20)
    at listOnTimeout (node:internal/timers:568:17)
    at processTimers (node:internal/timers:510:7)

Node.js v17.3.0

Am I missing something? Did the CLI's API change on this experimental version?

(I put a console.log on the conf object that raises the error, maybe it helps)

@khrome
Copy link
Owner

khrome commented Apr 11, 2022

If you just want to use it, try npm install -g asciiart@2.7.0 (the last version to bundle yargs), if you want to dev pull the ascii-art-cl repo and do a dev install. Either way should work.

The specific error you're getting is related to plugin support which allows you to 1) fetch remote URLs and 2) install plugins for particular ascii-art sources. (the last release was the first feature complete version for this change, so it's likely that this broke something).

The good news is come 3.0 there will be command line tests, to limit this (currently tests are for the API only)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants