【发布时间】:2020-09-24 12:49:24
【问题描述】:
我做了一个新的“npm init”。放置入口点:“index.html”
然后安装 lite-server : npm install lite-server --save-dev
还更新了 package.json 和我卸载,重新安装尝试了一切,但它不工作和
也试过npm cache clean --force,但它不起作用。任何人都可以帮助解决这个错误。
{
"name": "git-test",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run lite",
"lite": "lite-server"
},
"author": "Sateesh",
"license": "ISC",
"dependencies": {
"lite-server": "^2.5.4"
}
}
但当我执行“npm start”时,出现此错误
git-test@1.0.0 start D:\Coursera\git-test
> npm run lite
'npm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! git-test@1.0.0 start: `npm run lite`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the git-test@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sai\AppData\Roaming\npm-cache\_logs\2020-06-05T10_20_11_723Z-debug.log
【问题讨论】:
-
为什么不只是
"start": "lite-server"? -
抱歉没用@ManuelSpigolon
-
嗨,
npm run lite直接在终端上也失败了吗? -
没有同样的错误@PraveenThirumurugan
-
您好,您能不能快速进入系统属性(搜索路径)> 环境变量> 系统变量> 路径> 编辑> 查找是否添加了NPM路径。
标签: node.js npm lite-server