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 天前
jev-ultrafast 深度解析:7 秒订机票的浏览器 Agent 是如何炼成的
前端·后端·agent
子兮曰4 天前
Jev 爆发一周:7 秒 Agent 背后的 System One 生态与三场争议
前端·后端·ai编程
前端小万4 天前
写公众号赚了 3000 块后,我做了一款叫 "一键成稿" 的软件
前端·微信小程序
爱勇宝4 天前
ZCode 开源 24 小时:一份没有历史的账本,回答不了"有没有偷代码"
前端·后端·chatglm (智谱)
A黄俊辉A4 天前
uniapp webview中实现 app和内嵌的H5双向通信
vue.js·json
三十而立洋4 天前
Cookie 详解:从产生到安全,一次讲透
前端·javascript
卡布鲁5 天前
把一个 Vite + Vue3 应用塞进 qiankun (React + Umi3) 主站:十个坑的复盘
前端·javascript·react.js
李少兄5 天前
JavaScript 隐式全局变量解析
javascript
honkun65 天前
vue 表格组件 vxe-table 配置 ajax 请求自动加载数据与表单查询
vue.js·vxe-table
kybs19915 天前
全球灾害数据分析可视化 毕业设计-附源码66794
vue.js·spring boot·mysql·安全·django·c#·asp.net