开发环境:mac系统,node版本: 16.15.0
vite v3.2.4 building for development...
'hasInjectionContext' is not exported by node_modules/pinia/node_modules/vue-demi/lib/index.mjs, imported by node_modules/pinia/dist/pinia.mjs
at ../node_modules/pinia/dist/pinia.mjs:6:9
4: * @license MIT
5: */
6: import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, del, nextTick, computed, toRefs } from 'vue-demi';
^
7: import { setupDevtoolsPlugin } from '@vue/devtools-api';
升级或降级(版本)
Vue和pinia 版本不兼容;Vue 的版本为 “vue”: “^3.2.47”, pinia的版本为 “pinia”: “^2.0.36”
升高pinia的版本 “pinia”: “^2.0.36”, ==》 “pinia”: “^2.0.36”,
先删除pinia
npm uni pinia
再重新安装
yarn add pinia@2.0.36
修改后如下图: