日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

解决 Angular 官网下载的库 Schematics 在 windows 环境不支持 .. 的临时解决方案

發布時間:2023/12/19 windows 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决 Angular 官网下载的库 Schematics 在 windows 环境不支持 .. 的临时解决方案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我在 Angular 官網下載的 library Schematics 例子,運行命令行 npm run build 時,遇到如下錯誤:

my-lib@0.0.1 build c:\Code\SPA\schematics-for-libraries\projects\my-lib
…/…/node_modules/.bin/tsc -p tsconfig.schematics.json

‘…’ is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-lib@0.0.1 build: ../../node_modules/.bin/tsc -p tsconfig.schematics.jsonnpm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-lib@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\I042416\AppData\Roaming\npm-cache_logs\2021-10-18T07_11_32_366Z-debug.log

問題的根源出現在 package.json 這一行:

“build”: “…/…/node_modules/.bin/tsc -p tsconfig.schematics.json”,

windows 不支持通過 …/…/ 去執行當前文件夾上級目錄里的某個可執行文件。

調用的其實是這個 tsc 文件:

臨時解決方案

在庫的 package.json 里增添 TypeScript 的 devDependencies 依賴:

然后使用庫當前目錄下的 node_modules 里的 tsc 進行編譯:

最后問題解決,可以開始編譯了。

更多Jerry的原創文章,盡在:“汪子熙”:

總結

以上是生活随笔為你收集整理的解决 Angular 官网下载的库 Schematics 在 windows 环境不支持 .. 的临时解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。