vue使用命令随笔

###环境

node -v 获取nodejs版本

npm -v 获取npm版本

python --version或者python3 --version 查看python版本

npm cache clean --force 清除npm缓存并尝试重新安包

npm cache verify 用于验证和清理 npm 缓存

npm install -g cnpm --registry=https://registry.npm.taobao.org

###NPM配置

npm 的全局配置文件一般位于 C:\Users\你的用户名\AppData\Roaming\npm\npmrc。而用户的本地配置文件一般位于项目根目录下的 .npmrc 文件中

npm config list -l 获取npm所有配置

npm config set registry http://registry.npm.taobao.org/ 设置registry为淘宝镜像或者其他镜像源

npm config get registry 获取镜像地址

npm config get cafile 获取npm的证书

npm config get registry 获取npm镜像的信息

npm config get strict-ssl 获取SSL验证

npm config set strict-ssl false 关闭SSL验证

npm config set strict-ssl true 开启SSL验证

###NPM安装

npm install -g npm@8.9.0 安装npm

Node.js 12.x LTS 版本搭配的 npm 版本通常是 6.x.x。

Node.js 14.x LTS 版本搭配的 npm 版本通常是 6.x.x 或 7.x.x。

Node.js 16.x LTS 版本搭配的 npm 版本通常是 7.x.x 或 8.x.x。

###依赖包-node-sass

npm config set sass_binary_site http://south.repo.devops.piccnet/generic/picc/binary/node_sass/ 指定node_sass下载地址

npm rebuild node-sass #重新构建 node-sass

###依赖包-node_gyp

npm list -g node-gyp 检查全局安装的

node-gyp -v 获取node-gyp版本

npm install -g node-gyp@8.1.0 安装node-gyp

npm config set node_gyp /data/devops/apps/nodejs//node-gyp 使用全局安装的 node-gyp 进行项目的编译

npm list -g node-gyp 检查全局安装的

其他

du -sh --block-size=M /data/devops/workspace/node_modules 查看文件大小,以M为单位

复制代码
package.json字段
相关推荐
Jerry24 分钟前
使用 Material 3 在 Compose 中设置主题
前端
耶啵奶膘30 分钟前
uni-app头像叠加显示
开发语言·javascript·uni-app
chéng ௹31 分钟前
uniapp 封装uni.showToast提示
前端·javascript·uni-app
生擒小朵拉1 小时前
STM32添加库函数
java·javascript·stm32
tuokuac1 小时前
nginx配置前端请求转发到指定的后端ip
前端·tcp/ip·nginx
程序员爱钓鱼1 小时前
Go语言实战案例-开发一个Markdown转HTML工具
前端·后端·go
万少1 小时前
鸿蒙创新赛 HarmonyOS 6.0.0(20) 关键特性汇总
前端
还有多远.2 小时前
jsBridge接入流程
前端·javascript·vue.js·react.js
蝶恋舞者2 小时前
web 网页数据传输处理过程
前端
非凡ghost2 小时前
FxSound:提升音频体验,让音乐更动听
前端·学习·音视频·生活·软件需求