复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#历史版本https://nodejs.org/en/download/releases/ 1.下载安装包 wget https://nodejs.org/dist/v14.20.0/node-v14.20.0-linux-x64.tar.xz 2.解压并放入制定目录 tar -xf node-v14.20.0-linux-x64.tar.xz mv node-v14.20.0-linux-x64 /usr/local/node 3.建立软链接 ln -s /usr/local/node/bin/node /usr/bin/node ln -s /usr/local/node/bin/npm /usr/bin/npm 4,配置淘宝镜像 npm config set registry https://registry.npm.taobao.org 5.查看是否切换成功 npm config get registry 如果npm不好使,使用cnpm npm install -g cnpm --registry=https://registry.npmjs.org/ ln -s /usr/local/node/bin/cnpm /usr/bin/cnpm
依赖仓库
复制代码
1
2
3
4
5
6依赖搜索1 https://npmmirror.com/ 依赖搜索2 https://www.npmjs.com/ 依赖搜索3 https://openbase.com/ 也可自行搭建nexus仓库
编译命令
复制代码
1
2
3
4
5
6
7
8
9
10
11npm cache clean --force npm install --registry='依赖服务器地址' #不加--registry 选项 默认使用官方依赖地址 npm run build #编译中缺少依赖建议先去依赖仓库搜索 在尝试单独安装某个依赖 npm install 依赖名称[@依赖版本] 例如: npm install bignumber.js 或者: npm i bignumber.js@9.0.1 #其他编译问题可尝试更换nodejs不同版本 或删除项目下 node_modules目录与 package-lock.json 文件重新编译
最后
以上就是老迟到草莓最近收集整理的关于使用nodejs编译vue项目的全部内容,更多相关使用nodejs编译vue项目内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复