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字段
相关推荐
朱涛的自习室4 分钟前
高价软件已死,我让 AI 开启了「平替计划」(Day 7 / 7)
android·前端·github
沙蒿同学20 分钟前
Wails v3 实战:一个桌面提醒客户端,从 v2 升到 v3 的全过程
前端·后端·github
inquisiter38 分钟前
KernelGpt的部分尝试
java·前端·apache
the局外人1 小时前
用 TRAE 把 Markdown文档 搬到微信公众号
前端
Autumn_ing1 小时前
AI原型设计工具怎么选?可编辑原型与可运行前端适合什么场景
前端·小程序·产品经理·代码·codex·墨刀ai客户端·ai原型
夕阳_醉了2 小时前
前端通用组件开发全指南|从 0 到 1 打造稳定可复用的业务组件
前端
Amos_Web2 小时前
Rspack 源码解析(三十):SourceMapDevToolPlugin 如何生成并关联 source map
前端
console.log('npc')2 小时前
从0到1实现任务评价统计功能:React + TypeScript 实战指南(小白注释版)
前端·react.js·typescript
IT_陈寒2 小时前
为什么你应该学习React?
前端·人工智能·后端
ZoeLandia2 小时前
React04:事件处理与受控表单
开发语言·前端·react.js·typescript