vue使用过程的报错

775 阅读1分钟

1 安装全局vue_cli 3.0 的报错

报错代码:

! errno -4048
npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
//报错重要信息:
//operation not permitted,:不允许操作,
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 (though this is not recommended)

报错信息与解决方案:

当前不允许操作,这时候应该用管理员身份进入CMD,便可解决 window10下,通过搜索框搜索cmd,显示后右击从管理员身份运行即可

js本地多文件上传

通过 window.URL.createObjectURL(curFiles[i]) 以及 css 产生预览图. var image = document.createElement('img'); // 生成blob对象 image.src = window.URL.createObjectURL(curFiles[i]);