yujinpan/el-table-infinite-scroll

npm install --save el-table-infinite-scroll安装的始终是2.0.2版本,怎么解决?

Closed this issue · 4 comments

npm install --save el-table-infinite-scroll安装的始终是2.0.2版本

"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"ejs": "^3.1.10",
"el-table-infinite-scroll": "^2.0.2",
"element-plus": "^2.7.6",
"qs": "^6.12.2",
"vue": "^3.4.29",
"vue-router": "^4.0.13"
},

是跟我的node版本有关系么?我用的是ubuntu 2404自带的node
root@develop:~/projects/app-czy# node -v
v18.19.1

npm i xxx@3
npm i xxx@3

谢谢,用上了3.0.5版本,按照你的示例做了全局注册,仍然是注册不上;组件注册也注册不上,报错都是这个:

TypeError: Cannot read properties of undefined (reading 'prototype')
at node_modules/el-table-infinite-scroll/node_modules/element-ui/lib/utils/types.js (types.js:39:135)
at __require (chunk-V4OQ3NZ2.js?v=5ebd33a7:11:50)
at 17 (infinite-scroll.js:282:18)
at webpack_require (infinite-scroll.js:21:30)
at 141 (infinite-scroll.js:101:14)
at webpack_require (infinite-scroll.js:21:30)
at infinite-scroll.js:85:18
at node_modules/el-table-infinite-scroll/node_modules/element-ui/lib/infinite-scroll.js (infinite-scroll.js:86:10)
at __require (chunk-V4OQ3NZ2.js?v=5ebd33a7:11:50)
at el-table-infinite-scroll.js:8:28

package.json的部分内容:
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"ejs": "^3.1.10",
"el-table-infinite-scroll": "^3.0.5",
"element-plus": "^2.7.6",
"qs": "^6.12.2",
"vue": "^3.4.29",
"vue-router": "^4.0.13"
},

at node_modules/el-table-infinite-scroll/node_modules/element-ui/lib/infinite-scroll.js (infinite-scroll.js:86:10)
at __require (chunk-V4OQ3NZ2.js?v=5ebd33a7:11:50)
at el-table-infinite-scroll.js:8:28

报错信息中还是有 element-ui,需要清除 vite 缓存,删除 node_modules/.vite,重启 vite 服务器。

at node_modules/el-table-infinite-scroll/node_modules/element-ui/lib/infinite-scroll.js (infinite-scroll.js:86:10)
at __require (chunk-V4OQ3NZ2.js?v=5ebd33a7:11:50)
at el-table-infinite-scroll.js:8:28

报错信息中还是有 element-ui,需要清除 vite 缓存,删除 node_modules/.vite,重启 vite 服务器。

可以了,非常感谢!