mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

Cannot Find Module "api-console-cli-build" on Windows #12

Closed lukibsubekti closed 6 years ago

lukibsubekti commented 6 years ago

I have tried installing it globally and locally. But, when I run:

$ api-console build --help

or (for local):

$ ./node_modules/.bin/api-console build --help

on my Windows, it results:

Error: Cannot find module 'my\current\path\api-console-cli-build'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

I tried on my Linux and Mac, it works normally. I use latest Node and NPM.

jarrodek commented 6 years ago

Thank you for the issue report. I have to investigate this on Windows.

amcsi commented 6 years ago

Please make this project cross-platform :(

jarrodek commented 6 years ago

It actually is cross-platform but not cross-all-node-versions. Which node version do you use? Most dependencies of this project requires node >= 6.4.0

I have installed the CLI tool just a minute ago on my windows machine and it is installed and working . So the only thing I can think of right now is node's version.

jarrodek commented 6 years ago

This is fixed by https://github.com/mulesoft-labs/api-console-cli/commit/8a0b46c0bea54e222a72f52e57485c444c4e2163 If not please reopen.

amcsi commented 6 years ago

This still doesn't work, unfortunately.

C:\Users\attila\project>node -v
v8.7.0

C:\Users\attila\project>api-console -V
0.2.5

C:\Users\attila\project>api-console serve documentation/
module.js:473
      throw err;
      ^

Error: Cannot find module 'C:\Users\attila\project\api-console-cli-serve'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:453:25)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

C:\Users\attila\project>api-console build documentation\documentation.raml
module.js:473
      throw err;
      ^

Error: Cannot find module 'C:\Users\attila\project\api-console-cli-build'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:453:25)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
jarrodek commented 6 years ago

OK, thank you for detailed description. I'll try to fix it in the morning.

jarrodek commented 6 years ago

Hi,

Thank you all for your patience. I've isolated the problem. It appears to be an issue with helper library. I've reported an issue already: https://github.com/tj/commander.js/issues/714 Also, I've prepared a workaround in the CLI tool which enables use of the CLI tool on Windows. I will release it later today after writing few tests that ensures that this will not happen again.

Sorry guys for that.