我使用以下package.json
处理角度包
https://www.npmjs.com/package/mds.angular.datetimepicker
{
"name": "mds.angular.datetimepicker",
"version": "2.0.5",
"description": "Persian and gregorian DateTimePicker with angular and materials",
"license": "MIT",
"main": "./index.js",
"types": "./index.d.ts",
"moduleResolution": "node",
"author": {
"name": "Mohammad Dayyan",
"url": "https://github.com/Mds92/mds-angular-datetime-picker-package"
},
"repository": {
"type": "public",
"url": "https://github.com/Mds92/mds-angular-datetime-picker-package"
},
"homepage": "https://github.com/Mds92/mds-angular-datetime-picker-package",
"dependencies": {},
"devDependencies": {
"@angular/animations": "^5.0.3",
"@angular/cdk": "^5.0.0-rc.1",
"@angular/cli": "^1.5.4",
"@angular/common": "^5.0.3",
"@angular/compiler-cli": "^5.0.3",
"@angular/core": "^5.0.3",
"@angular/forms": "^5.0.3",
"@angular/http": "^5.0.3",
"@angular/material": "^5.0.0-rc.1",
"@angular/platform-browser": "^5.0.3",
"core-js": "^2.5.1",
"hammerjs": "^2.0.8",
"mds.persian.datetime": "^0.9.82",
"rxjs": "^5.5.2",
"typescript": "^2.6.1",
"zone.js": "^0.8.18"
}
}
我创建了一个定义文件index.ts
,如下所示:
export * from "./mds-datetime-picker.module";
export * from "./services/mds-datetime-picker-resources.service";
export * from "./components/mds-datetime-picker.component";
export * from "./components/core/mds-datetime-picker-core.component";
export * from "./assests/mds-datetime-picker.utility";
export * from "./assests/enums";
export * from "./assests/interfaces";
tsc -d
命令成功运行,index.d.ts
创建如下:
export * from "./mds-datetime-picker.module";
export * from "./services/mds-datetime-picker-resources.service";
export * from "./components/mds-datetime-picker.component";
export * from "./components/core/mds-datetime-picker-core.component";
export * from "./assests/mds-datetime-picker.utility";
export * from "./assests/enums";
export * from "./assests/interfaces";
问题:
当我使用npm i mds.angular.datetimepicker@latest
在另一个项目(示例项目)中安装此软件包时,我在ng build
命令
ERROR in ./node_modules/mds.angular.datetimepicker/assests/enums.ts
Module build failed: Error: D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\mds.angular.datetimepicker\assests\enums.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:625:23)
at plugin.done.then (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
@ ./node_modules/mds.angular.datetimepicker/index.js 11:9-35
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/mds.angular.datetimepicker/assests/mds-datetime-picker.utility.ts
Module build failed: Error: D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\mds.angular.datetimepicker\assests\mds-datetime-picker.utility.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:625:23)
at plugin.done.then (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
@ ./node_modules/mds.angular.datetimepicker/index.js 10:9-57
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/mds.angular.datetimepicker/components/core/mds-datetime-picker-core.component.ts
Module build failed: Error: D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\mds.angular.datetimepicker\components\core\mds-datetime-picker-core.component.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:625:23)
at plugin.done.then (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
@ ./node_modules/mds.angular.datetimepicker/index.js 9:9-72
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/mds.angular.datetimepicker/components/mds-datetime-picker.component.ts
Module build failed: Error: D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\mds.angular.datetimepicker\components\mds-datetime-picker.component.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:625:23)
at plugin.done.then (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
@ ./node_modules/mds.angular.datetimepicker/index.js 8:9-62
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/mds.angular.datetimepicker/mds-datetime-picker.module.ts
Module build failed: Error: D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\mds.angular.datetimepicker\mds-datetime-picker.module.ts is not part of
the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:625:23)
at plugin.done.then (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
@ ./node_modules/mds.angular.datetimepicker/index.js 6:9-48
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/mds.angular.datetimepicker/services/mds-datetime-picker-resources.service.ts
Module build failed: Error: D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\mds.angular.datetimepicker\services\mds-datetime-picker-resources.service.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:625:23)
at plugin.done.then (D:\Sources\Mds92.github.io\MdsDateTimePickerSample\node_modules\@ngtools\webpack\src\loader.js:467:39)
at process._tickCallback (internal/process/next_tick.js:109:7)
@ ./node_modules/mds.angular.datetimepicker/index.js 7:9-68
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
我在ng build --prod
命令
ERROR in Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(28,117): Property 'templateType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(33,125): Property 'templateType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(43,115): Property 'textBoxType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(48,123): Property 'textBoxType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(58,113): Property 'inLine' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(63,105): Property 'inLine' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(73,119): Property 'isPersian' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(78,111): Property 'isPersian' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(88,123): Property 'persianChar' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(93,115): Property 'persianChar' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(103,121): Property 'timePicker' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(108,113): Property 'timePicker' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(118,127): Property 'rangeSelector' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(123,119): Property 'rangeSelector' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(132,73): Property 'format' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(138,73): Property 'placeHolder' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(144,73): Property 'buttonIcon' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(28,117): Property 'templateType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(28,144): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(33,125): Property 'templateType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(33,152): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(43,115): Property 'textBoxType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(43,141): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(48,123): Property 'textBoxType' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(48,149): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(58,113): Property 'inLine' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(58,134): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(63,105): Property 'inLine' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(63,126): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(73,119): Property 'isPersian' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(73,143): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(78,111): Property 'isPersian' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(78,135): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(88,123): Property 'persianChar' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(88,149): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(93,115): Property 'persianChar' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(93,141): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(103,121): Property 'timePicker' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(103,146): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(108,113): Property 'timePicker' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(108,138): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(118,127): Property 'rangeSelector' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(118,155): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(123,119): Property 'rangeSelector' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(123,147): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(132,73): Property 'format' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(132,94): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(138,73): Property 'placeHolder' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(138,99): Property 'settingChange' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(144,73): Property 'buttonIcon' does not exist on type 'AppComponent'.
Error at D:/Sources/Mds92.github.io/MdsDateTimePickerSample/src/app/app.component.html(144,98): Property 'settingChange' does not exist on type 'AppComponent'.
package.json
中的sample-project
{
"name": "mds-date-time-picker-sample",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.3",
"@angular/cdk": "^5.0.0-rc.1",
"@angular/common": "^5.0.3",
"@angular/compiler": "^5.0.3",
"@angular/core": "^5.0.3",
"@angular/forms": "^5.0.3",
"@angular/http": "^5.0.3",
"@angular/material": "^5.0.0-rc.1",
"@angular/platform-browser": "^5.0.3",
"@angular/platform-browser-dynamic": "^5.0.3",
"@angular/router": "^5.0.3",
"core-js": "^2.5.1",
"mds.angular.datetimepicker": "^2.0.5",
"mds.persian.datetime": "^0.9.82",
"rxjs": "^5.5.2",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.5.4",
"@angular/compiler-cli": "^5.0.3",
"@angular/language-service": "^5.0.3",
"@types/jasmine": "^2.8.2",
"@types/jasminewd2": "^2.0.3",
"@types/node": "^8.0.53",
"codelyzer": "^4.0.1",
"jasmine-core": "^2.8.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-jasmine": "^1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.2.0",
"ts-node": "^3.3.0",
"tslint": "^5.8.0",
"typescript": "^2.6.1"
}
}
示例项目中的 App.moodule.ts
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MdsDatetimePickerModule } from 'mds.angular.datetimepicker';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule, MdsDatetimePickerModule, FormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.ts
示例项目
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
app.component.html
为空
我的项目是角度4.4.2并且运行良好,在更新到5.0.3后发生了错误