npm install lite-server --save-dev 安装报错

npm install lite-server --save-dev installation error

第一次尝试使用node,安装node.js下面是资料

node -v
v14.4.0
npm -v
6.14.5

通过创建 package.json 文件完成设置,然后尝试使用命令安装 lite-server npm install lite-server --save-dev 产生了以下错误:

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ojhaa\AppData\Roaming\npm-cache\_logs20-06-06T06_54_54_480Z-debug.log

紧随其后 npm 缓存清理 --force

这是 package.json 文件

{
  "name": "git-test",
  "version": "1.0.0",
  "description": "\"This is a test directory to learn git and node\"",
  "main": "index.html",
  "scripts": {
    "start": "npm run lite",
    "test": "echo \"Error: no test specified\" && exit 1",
    "lite": "lite-server"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/apoorva0212/git-test.git"
  },
  "author": "\"Apoorva Ojha\"",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/apoorva0212/git-test/issues"
  },
  "homepage": "https://github.com/apoorva0212/git-test#readme"
}

但我仍然得到同样的错误。谁能帮我这个? 提前谢谢你。

您缺少对 lite-server

的依赖

尝试安装 lite-server 依赖项

npm install lite-server --save-dev

然后调用 npm run lite