卸载vue2.0,并且安装vue3.0怎么都安装不上,突然发现是环境变量配置的问题。之前一直用vue2.0去开发项目但是随着尤神开发vue3,也要跟着尤神的脚步嗨起来。
在这里插入图片描述
查看node的安装位置并且按照https://blog.csdn.net/ccsundhine/article/details/109361545这个博客去配置,但是在安装vue3.0的过程中遇到

   npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.staging',
npm ERR!   parent: '@babel/helper-compilation-targets'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\86189\AppData\Roaming\npm-cache\_logs\2021-01-02T03_08_47_654Z-debug.log

心酸,就解决呗。
在这里插入图片描述
在我安装项目中删掉npmrc这个文件夹就解决了。每个人环境配置不一样,可能位置会不同,所以一定要耐心找哦

还有一种,就是死活vue3.0都安装成功了,vue -v打印出来的就是3.0版本以上了,我们就可以
window+x打开用管理员的身份去输入安装并且创建项目。
在这里插入图片描述
安装完成后打开项目
在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐