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字段
相关推荐
不羁的fang少年6 分钟前
前端常见问题(vue,css,html,js等)
前端·javascript·css
change_fate12 分钟前
el-menu折叠后文字下移
前端·javascript·vue.js
yivifu15 分钟前
CSS Grid 布局详解(2025最新标准)
前端·css
o***Z4482 小时前
前端性能优化案例
前端
张拭心2 小时前
前端没有实际的必要了?结合今年工作内容,谈谈我的看法
前端·ai编程
姜太小白2 小时前
【前端】CSS媒体查询响应式设计详解:@media (max-width: 600px) {……}
前端·css·媒体
weixin_411191842 小时前
flutter中WebView的使用及JavaScript桥接的问题记录
javascript·flutter
HIT_Weston2 小时前
39、【Ubuntu】【远程开发】拉出内网 Web 服务:构建静态网页(二)
linux·前端·ubuntu
百***06012 小时前
SpringMVC 请求参数接收
前端·javascript·算法
天外天-亮2 小时前
Vue + excel下载 + 水印
前端·vue.js·excel