javascript - Lite-server 无法启动,原因是“Unexpected token ...”
问题描述
我是 typescript 的新手并按照教程使用 lite-server,但是当我使用时npm start
出现以下错误:
D:\web_demo\tsTest\node_modules\micromatch\index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
^^^
SyntaxError: Unexpected token ...
at Object.exports.runInThisContext (vm.js:53:16)
at Object.Module._extensions..js (module.js:550:10)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\web_demo\tsTest\node_modules\browser-sync\dist\public\stream.js:3:18)
at Module._compile (module.js:541:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aa@1.0.0 start: `lite-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aa@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\zouxing\AppData\Roaming\npm-cache\_logs\2021-06-24T07_11_23_793Z-debug.log
我的npm
版本是4.6.1
,我的node
版本是6.2.0
。
我的 package.json 简单而正确:
{
"name": "aa",
"version": "1.0.0",
"description": "",
"main": "test.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start":"lite-server"
},
"author": "",
"license": "ISC",
"dependencies": {
},
"devDependencies": {
"lite-server": "^2.6.1"
}
}
怎么了?
解决方案
推荐阅读
- spring-boot - Spring Boot & RabbitMQ:消息转换内容类型
- javascript - 将 React 添加到工作区失败,EACCES:权限被拒绝,mkdir '/home/mint/.cache/Cypress'
- foreign-keys - Javers - 外键约束因 mysql 而失败
- mysql - 将空白单元格更新为 NULL 会导致所有单元格为 NULL
- java - 如何解决 maven-formatter-plugin 的问题?
- python - 如何在部分文本中搜索字符串?
- php - 之间添加内容
- linux - shell 脚本已从带有回显输出的 edbplus sql 结果中检索
- c# - 如何在 C# 的 powerpoint 中显示 smartart 图形的文本窗格
- excel - Excel - 获取数据集的第一条记录