安装vue3脚手架@vue/cli报4048错误

安装vue3脚手架@vue/cli报4048错误

@vue/cli报错在网上试了很多解决办法,这个最有用了,一定要试试

C:\Users\25077>npm install vue-cli -g
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path E:\Node\node_modules\.vue-cli-7tLVKUJI
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'E:\Node\node_modules\.vue-cli-7tLVKUJI'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'E:\Node\node_modules\.vue-cli-7tLVKUJI'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'E:\\Node\\node_modules\\.vue-cli-7tLVKUJI'
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\25077\AppData\Local\npm-cache\_logs\2022-02-16T08_15_05_960Z-debug-0.log

C:\Users\25077>npm install vue-cli -g

报如上错误是系统权限不够,(方法:通过目录找C:\Windows\System32\cmd.exe,然后右键单击,出现选项,选择以管理员身份运行即可)
然后再次输入安装命令:npm install @vue/cli -g即可安装成功。通过输入vue -V,查看vue版本,如果能出来下图则安装成功
​​​​vue版本

你可能感兴趣的:(vue.js,npm,javascript,node.js)