mokkabonna / inquirer-autocomplete-prompt

Autocomplete prompt for inquirer
ISC License
354 stars 82 forks source link

Add rxjs to dependencies #70

Closed 125m125 closed 4 years ago

125m125 commented 6 years ago

Moving inquirer to dev- and peerDependencies caused rxjs to become a dev-dependency ( https://github.com/mokkabonna/inquirer-autocomplete-prompt/commit/ae9ff83e9a1a7eae38e3d89b0c353001afdc10a8#diff-32607347f8126e6534ebc7ebaec4853dR1880 ). In some cases, this leads to errors because rxjs is not installed at a place that can be reached from inquirer-autocomplete-prompt. This happened for example at https://github.com/125m125/splconfigurator/pull/145, where rxjs is installed in the node_modules folder of inquirer:

> npm list rxjs
splconfigurator@0.0.3
└─┬ inquirer@6.2.0
  └── rxjs@6.3.2 

>  find node_modules/ -type d -name 'rxjs'
node_modules/inquirer/node_modules/rxjs

Which caused this error message ( https://travis-ci.org/125m125/splconfigurator/jobs/426576292#L446 ):

> npm install
...
[!] Error: Cannot find module 'rxjs/operators'
Error: Cannot find module 'rxjs/operators'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/travis/build/125m125/splconfigurator/node_modules/inquirer-autocomplete-prompt/index.js:16:21)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions..js (/home/travis/build/125m125/splconfigurator/node_modules/rollup/bin/rollup:1227:17)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
...

Adding rxjs as production dependency solves this problem.

imcuttle commented 6 years ago

I guess that @mokkabonna considered inquirer depends rxjs so that rxjs is not in dependencies.

San4eyZ commented 5 years ago

@mokkabonna If so, it seems to be mistake because rxjs is appearing in inquirer's node_modules, so inquirer-autocomplete-prompt can't reach it, unless it listed directly in dependencies or in dependencies of upper projects. So if you using some package directly, you should list it in your dependencies. So it is good idea to merge this pr. Or am I mistaken?

mokkabonna commented 4 years ago

Fixed in #113