npm install 报错 run `npm audit fix` to fix them, or `npm audit\` for details

Phenomenon: Open the project, execute npm install, and report an error:

insert image description here

reason:

  • Guess 1: There is a serious vulnerability in the dependent package and needs to be updated

    Solution:

    1.  npm audit fix
       npm audit fix --force
       npm audit
      

      1. npm audit fix : scans your project for vulnerabilities and automatically installs any updates compatible with vulnerable dependencies
      2. npm audit fix --force : installs semi-major updates for major dependencies
      3. npm audit : Scan your project for vulnerabilities, just show the details without fixing anything:

      insert image description here

      Meaning: There are 14 vulnerabilities that require human review and require manual installation.

      - unresolved

    2. Uninstall node, reinstall - successfully resolved

    3. Delete the node_modules file, and re-npm install
      is simple and rude, but this time it doesn't work! ! Still reporting bugs. - unresolved

    4. Use cnpm (Taobao mirror) - not tested

      The Taobao mirror source will be automatically repaired, and then download the relevant dependent packages

      Use the cnpm command line tool customized by Ali to replace the default npm, and enter the following code

      npm install -g cnpm --registry=http://registry.npmmirror.com
      

      The resolution of Taobao npm domain name is about to stop, and the major reconstruction and upgrade of npmmirror mirror site
      http://npm.taobao.org and http://registry.npm.taobao.org will be officially offline and stop DNS resolution on 2022.06.30. Check if the installation was successful:

       cnpm -v
      

      Next step:

      cnpm install
      
    5. using yarn - not tested

      download:

      npm install yarn -g
      

      Check version:

      yarn version
      

      Install:

      yarn
      

      run:

      yarn run dev
      
  • Guess 2: The question prompted is not an error

    Workaround: - not tested

    1. insert image description here

      Step 1: In fact, the above prompts have also given a solution or troubleshooting method, that is, immediately following the above prompts, enter the command line: Step 2: Then you can view the npm fund
      specific prompt content of the prompt, which is dependent on rewards and donations Prompt, and then enter a line of commands: Step 3: Just press npm run dev
      Enter, which is usually a reminder for developers to donate and support. After opening a github link, it will display the information that you need to donate. If you don’t want to donate or If you skip this prompt, just add –no-fund at the end, the specific command is as follows:npm install --no-fund

Guess you like

Origin blog.csdn.net/qq_45410764/article/details/129158111