[英]An unhandled exception occurred: Project 'ngx-mat-miyagi-dolab' does not exist.: cannot republish NPM package in Angular
我之前已经为 Angular 发布了一个 NPM 包,请看这里,还有GitHub 存储库。 现在我想添加一些新功能。
每当我给
ng build ngx-mat-miyagi-dolab --prod
这是我得到的错误:
我的理论:在某个地方,当我创建 NPM 库时,Angular 保留了应用程序的原始名称,我不记得了
我试图找到它,但没有成功。 尝试在项目文件夹内执行命令,没有成功。 我正在创建另一个项目,它运行良好,即使在项目创始人之外。 这让我得出结论,它是这个 NPM 库中特有的东西,是什么东西造成了这个头痛。
当然,我可以重建图书馆。 之前,如果可能的话,我想从问题中吸取教训!🤗😂😀
文章我曾经在这里学习创建那些库。
角度错误.log
[error] Error: Project 'ngx-mat-miyagi-dolab' does not exist.
at BuildCommand.initialize (D:\Amazon ebook (sandbox)\modelos matemáticos na medicina e biologia (ebook)\Miyagi-Do-lab-sandbox\app\node_modules\@angular\cli\models\architect-command.js:48:19)
at async BuildCommand.validateAndRun (D:\Amazon ebook (sandbox)\modelos matemáticos na medicina e biologia (ebook)\Miyagi-Do-lab-sandbox\app\node_modules\@angular\cli\models\command.js:127:9)
at async Object.runCommand (D:\Amazon ebook (sandbox)\modelos matemáticos na medicina e biologia (ebook)\Miyagi-Do-lab-sandbox\app\node_modules\@angular\cli\models\command-runner.js:204:24)
at async default_1 (D:\Amazon ebook (sandbox)\modelos matemáticos na medicina e biologia (ebook)\Miyagi-Do-lab-sandbox\app\node_modules\@angular\cli\lib\cli\index.js:80:31)
讨论
建议 #1:“将终端导航到项目的位置并重新运行”文件夹? 试过了! 从几个位置。
在项目文件夹中,在应用程序文件夹中尝试过,同样的错误。 在该文件夹中,如果您运行ng build --prod
(不带应用程序的名称),它会运行并构建,但它不会转到我可以运行npm publish
的 dist 文件夹。 看到以前可以用,我猜是我忘记了构建应用程序的名称,我已经更改了名称,现在我不记得了; 但 Angular 仍然以某种方式使用它。
项目文件夹中的 Package.json
{
"name": "ngx-mat-miyagi-dolab",
"version": "0.0.11",
"description": "This is set of public packages from Miyagi-Do lab, related to mathematical modeling applied to life sciences.",
"author": "Jorge Guerra Pires, PhD (jorgeguerrabrazil@gmail.com)",
"peerDependencies": {
"@angular/common": "^11.2.14",
"@angular/core": "^11.2.14"
},
"dependencies": {
"tslib": "^2.0.0",
"mathjs": "^10.0.0",
"@types/mathjs": "^9.4.2"
},
"repository": {
"type": "git",
"url": "https://github.com/JorgeGuerraPires/ngx-mat-miyagi-dolab/tree/master"
},
"bugs": {
"url": "https://github.com/JorgeGuerraPires/ngx-mat-miyagi-dolab/issues"
},
"homepage": "https://miyagi-do-lab.herokuapp.com",
"keywords": [
"angular",
"javascript",
"typescript",
"eulersmethod",
"numericalanalysis",
"differentialequations",
"bioinformatics",
"appliedmathematics",
"numericalsimulations",
"biomathematics"
],
"license": "MIT"
}
根据您发布的图像,您从D:\Amazon ebook (sandbox)\modelos matemáticos na medicine e biologia (eboot)\Miyagi-Do-lab-sandbox\app
打开的终端运行ng build ngx-mat-miyagi-dolab --prod
命令D:\Amazon ebook (sandbox)\modelos matemáticos na medicine e biologia (eboot)\Miyagi-Do-lab-sandbox\app
。 在那个位置,angular 找不到项目ngx-mat-miyagi-dolab
。
将您的终端导航到项目的位置并重新运行ng build -ngx-mat-miyagi-dolab --prod
命令,它应该可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.