我使用了摇摇欲坠的代码生成器来生成客户端代码,并且当我尝试构建项目时(在Visual Studio代码中),我收到一条错误消息,指出“找不到模块@ angular / core。我在运行npm install并在npm run build根目录并成功生成了node_modules文件夹。在该文件夹中,我确实看到了@angular文件夹及其下的核心文件夹,但该项目没有生成,并且我不断收到此错误消息。
ng -v:
Angular CLI: 6.1.2
Node: 8.11.3
OS: win32 x64
Angular: 6.1.1
... common, compiler, core, http, platform-browser
Package Version
------------------------------------------------------
@angular-devkit/architect 0.7.2 (cli-only)
@angular-devkit/core 0.7.2 (cli-only)
@angular-devkit/schematics 0.7.2 (cli-only)
@schematics/angular 0.7.2 (cli-only)
@schematics/update 0.7.2 (cli-only)
rxjs 6.2.2
typescript 3.0.1
我没有安装任何扩展程序,并且vs编辑器没有给我错误。仅当我构建项目时,我才会收到这些错误。
这是我的tsconfig.json文件:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"target": "es5",
"module": "es6",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,
"declaration": true,
"lib": [ "es6", "dom" ]
},
"exclude": [
"node_modules",
"dist"
],
"filesGlob": [
"./model/*.ts",
"./api/*.ts"
]
}
任何帮助将不胜感激!