Appearance
npm包
查看npm版本
npm -vnpm -v初始化包文件,加上-y可以跳过问答步骤
npm init -ynpm init -y安装项目依赖
npm installnpm install查看当前项目安装了哪些包,-g查看全局
npm listnpm list查看npm 命令
npm --helpnpm --help更新包
npm update 包名npm update 包名卸载包
npm uninstall 包名npm uninstall 包名查看配置信息
npm config listnpm config list查看镜像
npm config get registrynpm config get registry安装镜像
//这个坏了报错,需要换一个镜像源2024.1.22过期,https无法用
npm install cnpm -g --registry= https://registry.npm.taobao.org
//方法一:需要换一个源
npm install -g cnpm --registry=https://registry.npmmirror.com
//或者用官方的源
npm install -g cnpm --registry=https://registry.npmjs.org
//方法二:禁用ssl
npm config set strict-ssl false//这个坏了报错,需要换一个镜像源2024.1.22过期,https无法用
npm install cnpm -g --registry= https://registry.npm.taobao.org
//方法一:需要换一个源
npm install -g cnpm --registry=https://registry.npmmirror.com
//或者用官方的源
npm install -g cnpm --registry=https://registry.npmjs.org
//方法二:禁用ssl
npm config set strict-ssl false修改镜像,设置为其他镜像
npm config set registry https://registry.npmmirror.com/npm config set registry https://registry.npmmirror.com/
小洛的前端技术博客