Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

ErrorCorner

ErrorCorner Logo ErrorCorner Logo

ErrorCorner Navigation

  • Home
  • Contact Us
  • About Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Contact Us
  • About Us
Home/ Questions/Q 858
Answered
Kenil Vasani
Kenil Vasani

Kenil Vasani

  • 646 Questions
  • 567 Answers
  • 77 Best Answers
  • 26 Points
View Profile
  • 1
Kenil Vasani
Asked: December 19, 20202020-12-19T21:57:26+00:00 2020-12-19T21:57:26+00:00

How do I fix a vulnerable npm package in my package-lock.json that isn’t listed in the package.json?

  • 1

Github is telling me that a dependency in my package-lock.json file is vulnerable and outdated. The problem is that if I do npm install or npm update, neither of them update the dependency in the package-lock.json file.

I’ve done a lot of googling on this, as well as deleted the file and done npm install.

If anyone can help resolve this I’d hugely appreciate it. The package in question is Hoek, which I don’t actually have in my package.json file.

Many thanks in advance.

node.jsnpm
  • 1 1 Answer
  • 10 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    1. Kenil Vasani

      Kenil Vasani

      • 646 Questions
      • 567 Answers
      • 77 Best Answers
      • 26 Points
      View Profile
      Best Answer
      Kenil Vasani
      2020-12-19T21:55:51+00:00Added an answer on December 19, 2020 at 9:55 pm

      It sounds like Hoek is a dependency of one of your dependencies (so, a package you have in your package.json is requiring it from it’s own package.json).

      You’ve already tried deleting/reinstalling and updating your project dependencies without success, so it seems that the package dependency in question has an explicit or max version specified.

      Without seeing the package.json for each of your dependencies, it would be difficult to advise further on how to force an update.

      Edit:
      To help you identify which packages are using which dependencies, you can use NPM’s ls command: https://docs.npmjs.com/cli/ls

      For example, to see which packages are using Hoek:
      npm ls hoek

      Edit 2:
      As Ulysse BN correctly points out, if you have NPM version 6 or later, you can use npm audit fix to ask NPM to attempt to fix the vulnerabilities for you.

      Edit 3:
      Those reading this should also check out JBallin’s answer below. It expands on information I have given here, and is (in my opinion) a more structured answer that addresses OP’s question better. However – if you want a quick fix – this answer should suffice.

      • 1
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    You must login to add an answer.

    Forgot Password?

    Sidebar

    Ask A Question
    • Popular
    • Kenil Vasani

      SyntaxError: invalid syntax to repo init in the AOSP code

      • 5 Answers
    • Kenil Vasani

      runtimeError: package fails to pass a sanity check for numpy ...

      • 3 Answers
    • Kenil Vasani

      xlrd.biffh.XLRDError: Excel xlsx file; not supported

      • 3 Answers
    • Kenil Vasani

      Homebrew fails on MacOS Big Sur

      • 3 Answers
    • Kenil Vasani

      Error: PostCSS plugin tailwindcss requires PostCSS 8

      • 2 Answers

    Explore

    • Most Answered
    • Most Visited
    • Most Voted
    • Random

    © 2020-2021 ErrorCorner. All Rights Reserved
    by ErrorCorner.com