簡體   English   中英

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 文件完成設置,然后嘗試使用命令 npm install lite-server --save-dev 安裝 lite-server 產生以下錯誤:

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"
}

但我仍然得到同樣的錯誤。 誰能幫我這個? 先感謝您。

您缺少對lite-server的依賴

嘗試安裝 lite-server 依賴項

npm install lite-server --save-dev

然后調用npm run lite

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM