node安装中npm出现的错误导致cnpm安装失败
1.node.js下载
node中文网
2.检验node,npm是否正常
node -v
npm -v
3.检查npm报错
1.没有修改权限
npm WARN config global `--global`, `--local` are deprecated. Use `--location
打开nodejs文件夹。并打开两个文件 npm.cmd 和 npm
找到那2个文件里面的prefix -g替换为prefix --location=global
2.node目录权限不够
这种情况会导致cnpm安装失败
C:\Users\admin>npm -vnpm WARN logfile could not create logs-dir: Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_logs'npm WARN logfile could not be created: Error: ENOENT: no such file or directory, open 'C:\Program Files\nodejs\node_cache\_logs\-07-07T01_23_05_078Z-debug-0.log'npm WARN logfile could not create logs-dir: Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_logs'npm WARN logfile could not be created: Error: ENOENT: no such file or directory, open 'C:\Program Files\nodejs\node_cache\_logs\-07-07T01_23_05_505Z-debug-0.log'
找到node安装目录,右键属性,点击安全,设置users用户完全控制权限
4.安装cnpm
在node.js目录创建两个文件夹
node_cache
node_global
npm config set prefix "选择刚刚创建node_global文件路径"npm config set cache "选择刚刚创建node_cache文件路径"
安装cnpm
npm i -g cnpm --registry=https://registry.
vue中取消各种代码规范警告
Use /* eslint-disable */ to ignore all warnings in a file. 报错