【问题标题】:npm install lite-server --save-dev installation errornpm install lite-server --save-dev 安装错误
【发布时间】:2020-09-25 10:21:34
【问题描述】:

我是第一次尝试使用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\_logs\2020-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"
}

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

【问题讨论】:

  • 删除package-lock.jsonnode_modules再试一次。
  • @AluanHaddad 没有node_modules这样的文件夹。
  • package.json吗?如果不运行npm init
  • 是的,有一个package.json
  • 将您的package.json 添加到问题中

标签: javascript node.js windows npm npm-install


【解决方案1】:

你缺少对lite-server的依赖

尝试安装 lite-server 依赖项

npm install lite-server --save-dev

然后调用npm run lite

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-13
    • 1970-01-01
    • 2016-08-18
    • 2021-11-11
    • 1970-01-01
    • 2020-07-21
    相关资源
    最近更新 更多