Sivo 悉见

vue3 uni-app DeprecationWarning: Use of deprecated folder mapping “./” in the “exports”

匿名 · 更新于 2022/5/28

uni-app vue3 新项目(是不是uni-app好像不重要),报错如下:

11:32:40.864 (node:3508) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at D:\MyWork\HFHD\YL\medicalcare3\node_modules\vuex\package.json.
11:32:40.864 Update this package.json to use a subpath pattern like "./*".
11:32:40.871 (Use `node --trace-deprecation ...` to show where the warning was created)

找到项目中,node_modules/vuex/package.json文件
其中exports配置中的

"./": "./"
  • 1

改为

"./*": "./*"

也就是加上星号,据说是因为node版本16以上新增的错误提示,必须要指明*号。