国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【異常】Jenkins執(zhí)行前端項(xiàng)目Npm構(gòu)建時(shí),出現(xiàn)報(bào)錯(cuò)This dependency was not found: vue-class-component in ./node_modules/vu

這篇具有很好參考價(jià)值的文章主要介紹了【異?!縅enkins執(zhí)行前端項(xiàng)目Npm構(gòu)建時(shí),出現(xiàn)報(bào)錯(cuò)This dependency was not found: vue-class-component in ./node_modules/vu。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

一、報(bào)錯(cuò)截圖

同事的代碼變更,導(dǎo)致了在Jenkins無法執(zhí)行構(gòu)建
a new version of sass-loader is available. please upgrade for best experienc,007 - 大前端技術(shù),前端,vue.js,jenkins

13:50:30   WARN  A new version of sass-loader is available. Please upgrade for best experience.
13:50:31  TypeError: Cannot set property mark of #<Object> which has only a getter
13:50:31  TypeError: Cannot set property mark of #<Object> which has only a getter
13:50:31      at Object.connectTypeScriptPerformance (/data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/typescript-reporter/profile/TypeScriptPerformance.js:12:36)
13:50:31      at createTypeScriptReporter (/data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/typescript-reporter/reporter/TypeScriptReporter.js:36:49)
13:50:31      at Object.<anonymous> (/data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/reporter/reporter-rpc/ReporterRpcService.js:20:30)
13:50:31      at Generator.next (<anonymous>)
13:50:31      at /data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/reporter/reporter-rpc/ReporterRpcService.js:8:71
13:50:31      at new Promise (<anonymous>)
13:50:31      at __awaiter (/data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/reporter/reporter-rpc/ReporterRpcService.js:4:12)
13:50:31      at /data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/reporter/reporter-rpc/ReporterRpcService.js:18:88
13:50:31      at Object.<anonymous> (/data/jenkins/jenkins/workspace/xxx/node_modules/fork-ts-checker-webpack-plugin-v5/lib/rpc/RpcService.js:23:38)
13:50:31      at Generator.next (<anonymous>)
13:50:58   ERROR  Failed to compile with 2 errors1:50:56 PM
13:50:58  
13:50:58  This dependency was not found:
13:50:58  
13:50:58  * vue-class-component in ./node_modules/vue-property-decorator/lib/index.js, ./node_modules/vue-property-decorator/lib/decorators/Watch.js
13:50:58  
13:50:58  To install it, you can run: npm install --save vue-class-component
13:50:58   ERROR  Build failed with errors.
13:50:58  npm ERR! code ELIFECYCLE
13:50:58  npm ERR! errno 1
13:50:58  npm ERR! ids@1.0.0 build: `vue-cli-service build --mode prod`
13:50:58  npm ERR! Exit status 1
13:50:58  npm ERR! 
13:50:58  npm ERR! Failed at the ids@1.0.0 build script.
13:50:58  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
13:50:58  
13:50:58  npm ERR! A complete log of this run can be found in:
13:50:58  npm ERR!     /data/jenkins/.npm/_logs/2023-04-19T05_50_56_890Z-debug.log

二、報(bào)錯(cuò)說明

錯(cuò)誤的原因是項(xiàng)目中引入了vue-class-component,但是在項(xiàng)目的依賴列表中,卻沒有找到它,因此會(huì)報(bào)如上的錯(cuò)誤。

2.1 vue-class-component介紹

vue-class-component是一個(gè)用于類式Vue組件的TypeScript裝飾器。
它允許您將Vue組件定義為類,這可以使您的代碼更有組織性和易于閱讀。
它還提供了其他裝飾器,用于定義計(jì)算屬性、觀察者和事件處理程序。

官方文檔

2.2 使用vue-class-component

要使用vue-class-component,您首先需要通過npm安裝它:

npm install vue-class-component

安裝后,您可以在Vue組件文件中導(dǎo)入它,并使用@Component裝飾器將組件定義為類:

import { Component, Vue } from 'vue-class-component';

@Component
export default class MyComponent extends Vue {
  // 組件邏輯在這里
}

然后,您可以將組件的數(shù)據(jù)、方法和生命周期鉤子定義為類屬性和方法:

@Component
export default class MyComponent extends Vue {
  // 數(shù)據(jù)
  message: string = 'Hello, world!';

  // 方法
  onClick(): void {
    console.log('Button clicked!');
  }

  // 生命周期鉤子
  mounted(): void {
    console.log('Component mounted!');
  }
}

三、報(bào)錯(cuò)解決

引入vue-class-component即可,并且重新執(zhí)行一下Jenkins的構(gòu)建,即重新build一波試試,問題解決!
a new version of sass-loader is available. please upgrade for best experienc,007 - 大前端技術(shù),前端,vue.js,jenkins文章來源地址http://www.zghlxwxcb.cn/news/detail-772758.html

到了這里,關(guān)于【異?!縅enkins執(zhí)行前端項(xiàng)目Npm構(gòu)建時(shí),出現(xiàn)報(bào)錯(cuò)This dependency was not found: vue-class-component in ./node_modules/vu的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包