nvm list [available]:显示已安装的列表。可选参数available,显示可安装的所有版本。list可简化为ls。
nvm uninstall :卸载指定版本
nvm off:关闭nvm的nodejs版本管理
遇到的问题一:无法创建文件夹
解决办法:使用管理员身份打开cmd即可,给程序创建文件夹的权限
遇到的问题二:
1 2 3 4 5 6 7 8 9 10 11 12
PS C:\Users\asus\Desktop\visual_sense_3d>npm i cnpm -g npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network request to https://registry.npmjs.org/graceful-readlink failed, reason: connect ETIMEDOUT 104.16.25.35:443 npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Deshun\AppData\Roaming\npm-cache\_logs\2023-12-01T03_09_36_539Z-debug.log
解决方法:
1 2 3 4 5 6
1.查看npm镜像设置 npm config get registry 2.将npm设置为淘宝镜像 npm config set registry https://registry.npm.taobao.org 3.再次查看npm镜像设置 npm config get registry
remove(key) { const data = this.source, value = data[key]; delete data[key]; delete data[`${key}__expires__`]; return value; }
}
:hatched_chick:存取格式
localStorage 只支持 string 类型的存储,存入数字取出来的类型也是字符串
需要存入对象时先使用Json.stringify转换为json字符串,取出之后再转换为对象
1 2 3 4 5 6 7 8 9 10 11 12
var storage=window.localStorage; var data={ name:'xiecanyong', sex:'man', hobby:'program' }; var d=JSON.stringify(data); storage.setItem("data",d); //将JSON字符串转换成为JSON对象输出 var json=storage.getItem("data"); var jsonObj=JSON.parse(json); console.log(typeof jsonObj);
:hatched_chick:增删改查
1 2 3 4
localStorage.setItem("key", "value"); var lastname = localStorage.getItem("key"); localStorage.removeItem("key");//删除某个键值对 localStorage.clear()//删除所有localStorage