npm run build编译失败

提问 未结 2 103
思福泰
思福泰 VIP2 2022-11-10
悬赏:20积分
版本:renren-security 3.4.0企业版 开发环境:
npm run build > security-enterprise-tenant-admin@3.4.0 build D:\lijian\myrepos\CeictWebApps\renrenAdmin\security-enterprise-tenant-admin > npm run build:prod > security-enterprise-tenant-admin@3.4.0 build:prod D:\lijian\myrepos\CeictWebApps\renrenAdmin\security-enterprise-tenant-admin > vue-tsc --noEmit && vite build --mode production src/views/iframe.vue:3:40 - error TS2322: Type '() => void' is not assignable to type 'Event'. 3 <iframe class="iframe" :src="url" @load="load"></iframe> ~~~~ src/views/demo/news-add-or-update.vue:9:48 - error TS2322: Type '{}' is not assignable to type 'string'. 9 <WangEditor v-model="dataForm.content" style="height: 300px"></WangEditor> ~~~~~ src/layout/header/collapse-sidebar-btn.vue:33:32 - error TS2322: Type '() => void' is not assignable to type 'MouseEvent'. 33 <div class="hidden-xs-only" @click="onClickSidebarSwitcher"> ~~~~~ src/layout/header/collapse-sidebar-btn.vue:36:47 - error TS2322: Type '() => void' is not assignable to type 'MouseEvent'. 36 <div class="hidden-sm-and-up show-xs-only" @click="onClickSidebarSwitcherByMobile"> ~~~~~ src/views/ureport/ureport.vue:21:15 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'. 21 <a @click="onDesigner(scope.row)" class="el-button el-button--text el-button--small">{{ $t("design") }}</a> ~~~~~ src/views/demo/charts.vue:30:5 - error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. 30 [THEME_KEY]: "westeros" ~~~~~~~~~~~ src/views/ureport/ureport.vue:22:15 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'. 22 <a @click="onPreview(scope.row)" class="el-button el-button--text el-button--small">{{ $t("preview") }}</a> ~~~~~ src/layout/setting/index.vue:42:9 - error TS2322: Type '() => void' is not assignable to type 'MouseEvent'. 42 <div @click="onOpenSettingThemeWindow"> ~~~~~ src/layout/header/base-header.vue:48:17 - error TS2322: Type '() => void' is not assignable to type 'MouseEvent'. 48 <div @click="onRefresh" style="cursor: pointer"> ~~~~~ src/views/login.vue:35:103 - error TS2322: Type '() => void' is not assignable to type 'MouseEvent'. 35 <img style="vertical-align: middle; height: 40px; cursor: pointer" :src="captchaUrl" @click="onRefreshCode" alt="" /> ~~~~~ src/layout/setting/index.vue:55:29 - error TS2322: Type '() => void' is not assignable to type 'MouseEvent'. 55 <div class="copybtn" :onClick="onCopySetting"> ~~~~~~~~~ node_modules/_@vue_runtime-dom@3.2.41@@vue/runtime-dom/dist/runtime-dom.d.ts:1401:3 1401 onClick: MouseEvent ~~~~~~~ The expected type comes from property 'onClick' which is declared here on type 'ElementAttrs<HTMLAttributes>' src/layout/setting/setting-nav-layout.vue:58:119 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'. 58 <span :class="`card navlayout ${layoutToTheme[x.value]} ${state.active.layout === x.value ? 'active' : ''}`" @click="onSetTheme('layout', EThemeSetting.NavLayout, x.value)"></span> ~~~~~ src/layout/header/expand.vue:90:11 - error TS2322: Type '() => Promise<void>' is not assignable to type 'MouseEvent'. 90 <div @click="toggle" class="hidden-xs-only"> ~~~~~ src/layout/setting/setting-other.vue:81:135 - error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. 81 <setting-switch v-for="(x, index) in state.items" :key="x.label" :title="t(x.label)" :value="x.value" :onChange="onSetSwitch.bind(this, index, x)"></setting-switch> ~~~~ src/layout/setting/setting-theme.vue:71:100 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'. 71 <span :class="`card side ${x.value} ${state.active.sidebar === x.value ? 'active' : ''}`" @click="onSetTheme(EThemeSetting.Sidebar, 'sidebar', x.value)"></span> ~~~~~ src/layout/setting/setting-theme.vue:76:101 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'. 76 <span :class="`card header ${x.value} ${state.active.header === x.value ? 'active' : ''}`" @click="onSetTheme(EThemeSetting.TopHeader, 'header', x.value)"></span> ~~~~~ src/layout/setting/setting-theme.vue:81:123 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'. 81 <span :class="`color ${state.active.color === x.value ? 'active' : ''}`" :style="`background-color: ${x.value}`" @click="onSetTheme(EThemeSetting.ThemeColor, 'color', x.value)"></span> ~~~~~ src/utils/utils.ts:228:50 - error TS2345: Argument of type 'T' is not assignable to parameter of type 'Component<any, any, any, ComputedOptions, MethodOptions>'. Type 'T' is not assignable to type 'FunctionalComponent<any, any>'. 228 app.component(comp.name || comp.displayName, component); ~~~~~~~~~ src/utils/utils.ts:225:29 225 export const withInstall = <T>(component: T, alias?: string): T & Plugin => { ~ This type parameter might need an `extends FunctionalComponent<any, any>` constraint. src/utils/utils.ts:225:29 225 export const withInstall = <T>(component: T, alias?: string): T & Plugin => { ~ This type parameter might need an `extends Component<any, any, any, ComputedOptions, MethodOptions>` constraint. Found 18 errors in 13 files. Errors Files 1 src/views/iframe.vue:3 1 src/views/demo/news-add-or-update.vue:9 2 src/layout/header/collapse-sidebar-btn.vue:33 2 src/views/ureport/ureport.vue:21 1 src/views/demo/charts.vue:30 2 src/layout/setting/index.vue:42 1 src/layout/header/base-header.vue:48 1 src/views/login.vue:35 1 src/layout/setting/setting-nav-layout.vue:58 1 src/layout/header/expand.vue:90 1 src/layout/setting/setting-other.vue:81 3 src/layout/setting/setting-theme.vue:71 1 src/utils/utils.ts:228 npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! security-enterprise-tenant-admin@3.4.0 build:prod: `vue-tsc --noEmit && vite build --mode production` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the security-enterprise-tenant-admin@3.4.0 build:prod script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! D:\Users\EDZ\AppData\Roaming\npm-cache\_logs\2022-11-10T08_12_45_102Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! security-enterprise-tenant-admin@3.4.0 build: `npm run build:prod` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the security-enterprise-tenant-admin@3.4.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! D:\Users\EDZ\AppData\Roaming\npm-cache\_logs\2022-11-10T08_12_45_738Z-debug.log
回帖
  • node需要使用14或者16
    0 回复
  • 思福泰
    2022-11-11
    我的node版本是16的。 D:\lijian\myrepos\CeictWebApps\renrenAdmin\security-enterprise-tenant-admin>node -v v16.18.0 Found 2 errors in 2 files. Errors Files 1 src/views/demo/charts.vue:30 1 src/utils/utils.ts:228 D:\lijian\myrepos\CeictWebApps\renrenAdmin\security-enterprise-tenant-admin>code . D:\lijian\myrepos\CeictWebApps\renrenAdmin\security-enterprise-tenant-admin>node -v v16.18.0
    0 回复