mren / assert-outdated

0 stars 0 forks source link

Cannot read property 'indexOf' of undefined #8

Open Svish opened 5 years ago

Svish commented 5 years ago

With following script defined in package.json:

"lint:outdated": "assert-outdated-npm-modules --max-warnings 0 --ignore-pre-releases",
  1. Ran lint:outdated and got a list of outdated dependencies (as expected)
  2. Updated package.json with new versions
  3. Ran lint:outdated again, and got following errror (not expected):
C:\dev\project>npm run lint:outdated

> project@0.1.0 lint:outdated C:\dev\project
> assert-outdated-npm-modules --max-warnings 0 --ignore-pre-releases

TypeError: Cannot read property 'indexOf' of undefined
    at C:\dev\project\node_modules\assert-outdated\outdated.js:23:26
    at Array.filter (<anonymous>)
    at filterDependencies (C:\dev\project\node_modules\assert-outdated\outdated.js:22:49)
    at C:\dev\project\node_modules\assert-outdated\outdated.js:62:27
  1. Ran npm install to see if that helped
  2. Ran lint:outdated once again, and got no errors (as expected)

Seems when I update package.json, but don't run npm install, then outdated.js crashes for some reason?

mren commented 5 years ago

Thank you for using this module! Great that you found an error and reported it.

This error should of course not happen. Do you feel comfortable writing a pull request with a test? I would publish a fixed version ASAP.

Best!

Svish commented 5 years ago

@mren Definitely not, as I don't really understand what's happening in the first place. 😛 I did take a look at the code, but yeah, very newb in the non-browser javascript world... 😕

mren commented 5 years ago

Hey, no Problem! I currently don’t have the capacity to do this. If you feel like you are up to a challenge feel free to have a look. I can assist you with any questions you might have. Best!

jens-duttke commented 4 years ago

@Svish Can you provide the package.json? And which version of npm (npm -v) and node.js (node -v) are you using? I'll take a look into this.

Svish commented 4 years ago

@Svish Can you provide the package.json? And which version of npm (npm -v) and node.js (node -v) are you using? I'll take a look into this.

Long gone I'm afraid. But should be possible to replicate easily by making a simple one with just one outdated dependency and this one?