axetroy / vscode-package-manager

vscode extension for managing your Packages that installed in your computer. Support Homebrew/npm/pip/yarn/apt and more
https://marketplace.visualstudio.com/items?itemName=axetroy.vscode-package-manager
Other
18 stars 0 forks source link

Fixed NPM List Command to avoid errors #20

Closed shivam534d closed 2 years ago

shivam534d commented 2 years ago

Problem

This command on line:44 - npm.ts throws errors if invalid dependencies are found.

npm list -g --json --depth=1

error

Empty NPM List

Code_6xhNnAI2Ep

Error

Command failed with exit code 1: npm list -g --json --depth=1
npm ERR! code ELSPROBLEMS
npm ERR! invalid: cors@2.8.5 C:\Users\Shivam\AppData\Roaming\nvm\v18.4.0\node_modules\live-server\node_modules\cors
npm ERR! invalid: object-assign@4.1.1 C:\Users\Shivam\AppData\Roaming\nvm\v18.4.0\node_modules\live-server\node_modules\object-assign
npm ERR! invalid: opn@6.0.0 C:\Users\Shivam\AppData\Roaming\nvm\v18.4.0\node_modules\live-server\node_modules\opn
npm ERR! invalid: proxy-middleware@0.15.0 C:\Users\Shivam\AppData\Roaming\nvm\v18.4.0\node_modules\live-server\node_modules\proxy-middleware
npm ERR! invalid: send@0.18.0 C:\Users\Shivam\AppData\Roaming\nvm\v18.4.0\node_modules\live-server\node_modules\send
npm ERR! missing: react-dom@>=16.8, required by react-router-dom@6.3.0
npm ERR! missing: react@>=16.8, required by react-router-dom@6.3.0

Solution

npm list -g --json --depth 0

This depth will return packages installed while also avoiding those error thrown in the json.

After Solution

Code_mrHSi43RJo

shivam534d commented 2 years ago

Hope to get a new release soon with the changes, So that I can finally enable the Extension and start using it.

axetroy commented 2 years ago

LGTM! I will reformat it later.

axetroy commented 2 years ago

done. a new version has been published