【发布时间】: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.json和node_modules再试一次。 -
@AluanHaddad 没有node_modules这样的文件夹。
-
有
package.json吗?如果不运行npm init -
是的,有一个
package.json。 -
将您的
package.json添加到问题中
标签: javascript node.js windows npm npm-install