簡體   English   中英

發生未處理的異常:項目“ngx-mat-miyagi-dolab”不存在。:無法在 Angular 中重新發布 NPM 包

[英]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 上發布時

我的理論:在某個地方,當我創建 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM