rc/utils/utils.ts:241:50 - error TS2345: Argument of type 'T' is not assignable to parameter of type 'Component'.
Type 'T' is not assignable to type 'FunctionalComponent'.
241 app.component(comp.name || comp.displayName, component);
~~~~~~~~~
src/utils/utils.ts:238:29
238 export const withInstall = (component: T, alias?: string): T & Plugin => {
~
This type parameter might need an `extends FunctionalComponent` constraint.
src/utils/utils.ts:238:29
238 export const withInstall = (component: T, alias?: string): T & Plugin => {
~
This type parameter might need an `extends Component` constraint.
Found 1 error in src/utils/utils.ts:241
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! security-enterprise-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-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! C:\Users\15819\AppData\Roaming\npm-cache\_logs\2023-09-11T00_32_04_737Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! security-enterprise-admin@3.4.0 build: `npm run build:prod`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the security-enterprise-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! C:\Users\15819\AppData\Roaming\npm-cache\_logs\2023-09-11T00_32_04_763Z-debug.log
最后就去看了一下npm 相关知识 切换源 换cnpm pnpm 都试了终于找到原因了
可能这个问题都听过但是只有自己遇到了会比较深刻一点。yarn 是兼容npm 的以后项目有配置或者做项目都尽量用 yarn命令。
删除mode、package-lock.json
安装 yran
npm install -g yarn
npm uninstall yarn -g //yarn卸载
再次下载依赖
yarn install
打包
yarn build

OK搞定!