简体   繁体   English

使用 npm 安装 live-server 包时出错。 `npm audit` 无助于解决问题

[英]Getting error while installing live-server package using npm. `npm audit` is not helping to fix the problem

I am new to javascript.我是 javascript 的新手。 I am trying to learn javascript by following instructions here .我正在尝试按照此处的说明学习 javascript。 I am trying to install live-server package using npm but I am seeing the following error.我正在尝试使用 npm 安装live-server包,但我看到以下错误。

$ npm install -g live-server
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated opn@6.0.0: The package has been renamed to `open`
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

changed 208 packages, and audited 209 packages in 7s

2 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
sshil-414HTD6:IssueTracker sshil$  npm audit fix --force
npm WARN using --force Recommended protections disabled.

up to date, audited 1 package in 192ms

found 0 vulnerabilities

$ npm i live-server
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated opn@6.0.0: The package has been renamed to `open`
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 208 packages, and audited 209 packages in 6s

3 high severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
$ npm version
{
  issuetracker: '1.0.0',
  npm: '8.19.2',
  node: '19.0.0',
  v8: '10.7.193.13-node.16',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '111',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '8.1.0',
  openssl: '3.0.5+quic',
  cldr: '41.0',
  icu: '71.1',
  tz: '2022b',
  unicode: '14.0',
  ngtcp2: '0.8.1',
  nghttp3: '0.7.0'
}
  1. You shouldn't bother too much about it.你不应该太在意它。 It's more an warning than error.与其说是错误,不如说是警告。 And there is not much you can do.你无能为力。 To check if the package is installed, go in package.json file, it should be in dependencies object.要检查包是否已安装,请进入 package.json 文件,它应该在 dependencies 对象中。
  2. Nowadays if you use vscode you don't need to install live-server as it is already built in.现在如果你使用 vscode 你不需要安装 live-server 因为它已经内置了。

You can read more about npm audit here npm audit: Broken by Design您可以在此处阅读有关 npm audit 的更多信息 npm audit:Broken by Design

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM