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

shodown cli doesn't work with 2.0.0 #893

Closed
gbtami opened this issue Mar 1, 2022 · 12 comments
Closed

shodown cli doesn't work with 2.0.0 #893

gbtami opened this issue Mar 1, 2022 · 12 comments
Assignees
Labels

Comments

@gbtami
Copy link

gbtami commented Mar 1, 2022

Maybe src/ is not in install?

tamas@tami:~$ /usr/bin/showdown -i
internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '../src/cli/cli'
Require stack:
- /usr/lib/node_modules/showdown/bin/showdown.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/lib/node_modules/showdown/bin/showdown.js:2:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/lib/node_modules/showdown/bin/showdown.js' ]
}
@tivie
Copy link
Member

tivie commented Mar 1, 2022

Seems the src directory is missing from the npm repository. @SyntaxRules

@tivie
Copy link
Member

tivie commented Mar 1, 2022

Found the culprit 35730b7

@gbtami
Copy link
Author

gbtami commented Mar 1, 2022

After installing 2.0.1 I get this:

$ ./md2html.sh
/home/tamas/pychess-variants/node_modules/showdown/src/cli/makehtml.cmd.js:7
yargs.reset()
      ^

TypeError: yargs.reset is not a function
    at Object.<anonymous> (/home/tamas/pychess-variants/node_modules/showdown/src/cli/makehtml.cmd.js:7:7)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/tamas/pychess-variants/node_modules/showdown/src/cli/cli.js:37:3)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
/home/tamas/pychess-variants/node_modules/showdown/src/cli/makehtml.cmd.js:7

My script is here https://github.com/gbtami/pychess-variants/blob/master/md2html.sh

tivie added a commit that referenced this issue Mar 3, 2022
The CLI was completely rewrote. Changed dependency from yargs to commanderjs,
which is cleaner, faster and has no dependencies.
Also added a complete testsuite for the cli.

Closes #893, #894
@tivie
Copy link
Member

tivie commented Mar 6, 2022

Hey there. Can you try the new version? Should be working now.

@gbtami
Copy link
Author

gbtami commented Mar 6, 2022

  1. I update showdown version to 2.0.2 in my project package.json
  2. yarn install
    I get this
tamas@tami:~/pychess-variants$ showdown -h
internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '../../dist/showdown'
Require stack:
- /home/tamas/pychess-variants/node_modules/showdown/bin/showdown.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/tamas/pychess-variants/node_modules/showdown/bin/showdown.js:2:3661)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tamas/pychess-variants/node_modules/showdown/bin/showdown.js'
  ]
}
tamas@tami:~/pychess-variants$ ls -l node_modules/showdown/
összesen 36
drwxrwxr-x 2 tamas tamas  4096 márc   6 21:52 bin
drwxrwxr-x 2 tamas tamas  4096 márc   6 21:52 dist
-rw-r--r-- 1 tamas tamas  1072 okt   26  1985 LICENSE
-rw-r--r-- 1 tamas tamas  1622 okt   26  1985 package.json
-rw-r--r-- 1 tamas tamas 20212 okt   26  1985 README.md
tamas@tami:~/pychess-variants$ ls -l node_modules/showdown/dist/
összesen 764
-rw-r--r-- 1 tamas tamas 159755 okt   26  1985 showdown.js
-rw-r--r-- 1 tamas tamas 451629 okt   26  1985 showdown.js.map
-rw-r--r-- 1 tamas tamas  75209 okt   26  1985 showdown.min.js
-rw-r--r-- 1 tamas tamas  85554 okt   26  1985 showdown.min.js.map
tamas@tami:~/pychess-variants$ 

@gbtami
Copy link
Author

gbtami commented Mar 6, 2022

Maybe I'm doing something wrong. But this worked with 1.9.1

@tivie
Copy link
Member

tivie commented Mar 7, 2022

is showdown installed globally or locally? I've just tested a fresh install and it's working in my dev environment

@gbtami
Copy link
Author

gbtami commented Mar 7, 2022

I think "yarn install" works locally.

tivie added a commit that referenced this issue Mar 7, 2022
@tivie
Copy link
Member

tivie commented Mar 7, 2022

seems there's some path issues with yarn.

Can you replace the contents of node_modules/showdown/bin/showdown.js with the contents of this file? https://github.com/showdownjs/showdown/blob/version_2.x/src/cli/cli.js

Just copy this and paste/replace into node_modules/showdown/bin/showdown.js and test if the cli now works.

@tivie tivie added the bug label Mar 7, 2022
@gbtami
Copy link
Author

gbtami commented Mar 7, 2022

First of all thank you very much helping to solve this issue!
Unfortunately I'm ill with fever now, so possible can continue it next week only.

@tivie
Copy link
Member

tivie commented Mar 8, 2022

no problem. I hope you get better soon.

@tivie tivie closed this as completed in c3411a5 Mar 20, 2022
@gbtami
Copy link
Author

gbtami commented May 3, 2022

Today I updated showdown to 2.1.0 and it works like charm :)
Sry for the late reply and thx a lot!

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

No branches or pull requests

3 participants