I am new to typescript and follow the tutorial to use lite-server, but when I use npm start
I get the following error:
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
My npm
version is 4.6.1
and my node
version is 6.2.0
.
My package.json is simple and correct:
{
"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"
}
}
What is wrong?