Basically, all I'm doing is starting a new Angular project and loading it into a workspace. It doesn't look as if VS Code can do any linting or code sense because of this error. It's spitting up this error data:
{
"resource": "/Users/<snip!>/angular-project/src/app/app.module.ts",
"owner": "typescript",
"code": "2354",
"severity": 8,
"message": "This syntax requires an imported helper but module 'tslib' cannot be found.",
"source": "ts",
"startLineNumber": 13,
"startColumn": 1,
"endLineNumber": 26,
"endColumn": 3
}
I found an old bug somewhere that said moduleResolution
of tsconfig.json
had to be set to node
, but Angular CLI has already done that for me...
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
Edit: Steps I took to get here (using version 8 as of this writing):
- Install Angular CLI:
$ npm install -g @angular/cli
- Create the project:
$ ng new angular-project
- Serve the project:
$ ng serve
Does anyone know how to solve this?