使用npm install pinia 安装pinia报错。
修改镜像后也报错:
方式一:
bash
npm config set registry https://registry.npm.taobao.org/
npm install pinia
方式二:
bash
npm config set registry https://registry.npmjs.org/
npm install pinia
解决方法:
1.修改镜像
bash
npm config set registry https://registry.npmjs.org/
2.指定pinia版本安装:
bash
npm install pinia@2.0.23
3.再安装@pinia/nuxt,安装成功
bash
npm install @pinia/nuxt
4.修改nuxt.config.js
bash
modules: [
//...,
'@pinia/nuxt'
],
5.重新启动
bash
npm run dev