Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript &引用;角度引导md\index.ts不是编译输出的一部分;_Javascript_Node.js_Angular_Typescript - Fatal编程技术网

Javascript &引用;角度引导md\index.ts不是编译输出的一部分;

Javascript &引用;角度引导md\index.ts不是编译输出的一部分;,javascript,node.js,angular,typescript,Javascript,Node.js,Angular,Typescript,我想在我的项目中使用Angular Bootstrap,所以我寻找了一个关于如何下载和安装它,并让它在我的计算机上工作的教程。我正在为此使用Visual Studio代码。我找到了一个关于如何做到这一点的教程,这是一个: 我做了上面提到的每一步,但每当我想“ng开始”或“ng构建”时,我都会遇到这个奇怪的错误;基本上,每当我想要编译时,都会出现以下错误: bootstrap-weather@0.0.0 build C:\Users\Il\Desktop\WebFrameworks\Opdrac

我想在我的项目中使用Angular Bootstrap,所以我寻找了一个关于如何下载和安装它,并让它在我的计算机上工作的教程。我正在为此使用Visual Studio代码。我找到了一个关于如何做到这一点的教程,这是一个:

我做了上面提到的每一步,但每当我想“ng开始”或“ng构建”时,我都会遇到这个奇怪的错误;基本上,每当我想要编译时,都会出现以下错误:

bootstrap-weather@0.0.0 build C:\Users\Il\Desktop\WebFrameworks\Opdrachten\AngularBootstrapWeather\BootstrapWeather
> ng build

Date: 2017-11-07T16:19:07.296Z
Hash: d517558fb7e8e3484d3d
Time: 9269ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 8.17 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 200 kB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 465 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.29 MB [initial] [rendered]

ERROR in ./node_modules/angular-bootstrap-md/index.ts
Module build failed: Error: C:\Users\Il\Desktop\WebFrameworks\Opdrachten\AngularBootstrapWeather\BootstrapWeather\node_modules\angular-bootstrap-md\index.ts is not part
 of the compilation output. Please check the other error messages for details.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\Il\Desktop\WebFrameworks\Opdrachten\AngularBootstrapWeather\BootstrapWeather\node_modules\@ngtools\webpack\src\an
gular_compiler_plugin.js:629:23)
    at plugin.done.then (C:\Users\Il\Desktop\WebFrameworks\Opdrachten\AngularBootstrapWeather\BootstrapWeather\node_modules\@ngtools\webpack\src\loader.js:467:39)
    at process._tickCallback (internal/process/next_tick.js:109:7)
 @ ./src/app/app.module.ts 9:0-58
 @ ./src/main.ts
 @ multi ./src/main.ts

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files (x86)\\Brackets\\node.exe" "C:\\Program Files (x86)\\Brackets\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! bootstrap-weather@0.0.0 build: `ng build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap-weather@0.0.0 build script 'ng build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bootstrap-weather package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bootstrap-weather
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bootstrap-weather
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Il\Desktop\WebFrameworks\Opdrachten\AngularBootstrapWeather\BootstrapWeather\npm-debug.log
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.
它给出了一个奇怪的错误,说“index.ts”不是编译的一部分。。。当我查看Angular Bootstrap Md本身的“tsconfig.json”文件时,我看到:

{
  "compilerOptions": {
  "outDir": "../../../../dist/angular-bootstrap-md/free",
  "target": "es5",
  "module": "es2015",
  "moduleResolution": "node",
  "emitDecoratorMetadata": true,
  "experimentalDecorators": true,
  "sourceMap": true,
  "inlineSources": true,
  "noEmitHelpers": false,
  "noImplicitAny": false,
  "declaration": true,
  "skipLibCheck": false,
  "stripInternal": true,
  "allowSyntheticDefaultImports": true,
  "noUnusedLocals": false,
  "noUnusedParameters": false,
  "lib": ["dom", "es6"]
  },
  "exclude": [
  "node_modules"
  ],
  "files": [
  "./index.ts"
  ],
  "angularCompilerOptions": {
  "genDir": "../temp/factories",
  "strictMetadataEmit": true,
  "skipTemplateCodegen": true
  }
}
“Index.ts”显然包括在内,因为它是“files”主体的一部分。那么,为什么它说它不是“汇编的一部分”,而事实显然是这样?如何修复此错误,使引导程序最终可以在我的计算机上运行?另外,我不知道这是否值得一提,但我的“app.module.ts”看起来是这样的:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { MDBBootstrapModule } from 'angular-bootstrap-md';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MDBBootstrapModule.forRoot()
  ],
  providers: [],
  schemas: [ NO_ERRORS_SCHEMA ],
  bootstrap: [AppComponent]
})

export class AppModule { }

将其包含在
tsconfig.app.json中

"include": [

    "**/*.ts",

    "../node_modules/angular-bootstrap-md/index.ts"

  ],

路过

ng serve --prod

我想写下我的观点作为你的答案,但在此之前,请阅读以下内容:不,我从来没有做过,我从来没有做过克隆,我只是通过“npm安装”进行安装,这就是字面意思。教程中的内容就是我所做的,不多不少。5分钟快速入门中的说明在tsconfig.json中有这个条目。请注意Angular 6中有一个bug,它要求首先列出基本路径,否则您将在没有找到“AppModule”的NgModule元数据时得到-ERROR。