软件安装源代码 node、npm、yarn
最编程
2024-03-12 21:54:56
...
node安装-npm-yarn
node安装
- https://nodejs.org/en/download/ 进入官网下载安装包(下载msi安装程序)
- 电脑打开cmd--》 输入 echo %PATH% 查看环境变量是否添加
- 输入 node-v 和 npm-v 确认node和npm的版本号
- 更多详细操作可以看这篇文章 https://blog.****.net/weixin_39477597/article/details/87784418
npm-yarn安装
- npm install -g yarn
- 查看版本:yarn --version
- 淘宝源安装,复制粘贴以下代码行到cmd运行
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
中途可能会出现win10 powershell不允许运行脚本
解决方法:
- 管理员打开powershell
- PS C:\Users\Administrator> set-ExecutionPolicy RemoteSigned=
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): y - get-ExecutionPolicy 这个可以检查是否改好
常用的NPM和YARN指令
NPM | YAR | |
---|---|---|
初始化 | npm init | yarn init |
默认安装依赖 | npm install | yarn install |
安装某个依赖并保存 | npm install xxxx -save | yarn add xxxx |
安装全局依赖 | npm install -g xxxx | yarn global add xxxx |
移除依赖 | npm uninstall xxxx -save | yarn remove xxxx |
更新依赖 | npm update | yarn upgrade xxxx |
运行指令 | npm run | yarn run |
查看npm安装的依赖包版本
以下分两者情况来讲
尚未安装包
- npm view xxx依赖名 versions (查看所有可用版本)
- npm view xxx依赖名 version (查看最新版本)
- npm info xxx依赖名 (查看最新版本)
已经安装包
- npm ls xxx依赖名 (查看已经安装的版本)
- npm ls jquery -g (查看全局安装的版本)
上一篇: 在 Centos 7 上安装 yarn
下一篇: 网站项目】012 医院住院管理系统
推荐阅读
-
在 CentOS 7 上安装 Node.js 的 4 种方法(yum 安装和源代码安装)
-
安装、更新和卸载 NPM 软件包
-
Vue 使用 echarts(完整版,解决各种报告的错误)--注意:如果是全局模块错误,则进行全局更新,如果是项目模块错误,则移除(rimraf node_modules)重新安装(npm i)
-
npm install 安装时出现 node-gyp 重建错误
-
前端开发环境设置步骤说明 - npm install node-sass 安装失败解决方案
-
源码为您提供,零基础搭建的免费网址导航站--中国妖怪百集,收集了大量古代文献中的妖怪,非常详细的记录了妖怪的来历、描述甚至图片,让您对中国的妖怪文化有一个整体的了解,茶余饭后的消遣非常有趣,类似的网站还有很多,期待您的探索! 导航站的另一个特点是汇集了大量咖啡平时用的非常好的工具软件,其中大部分都是在线的,不需要下载安装,包括文档协作、分享,图片、音频、视频处理,格式转换,文件传输,各个网站的视频下载等等,兼职就是一个工具百宝箱! 如果你觉得这些网站不符合你的使用习惯,或者想添加一些自己收藏的网站,那么把源码交给你,只需简单修改就可以变成符合自己使用习惯的独特导航了! 如何修改 导航站采用纯静态构建,下载源代码后,只需要修改 html 文件中的代码块即可,代码块结构如下: 只需要修改四个地方,分别对应网站的四个关键信息: 修改相应网站的 URL 地址 修改相应网站的徽标 修改相应网站的名称
-
详细卸载和安装 Node.js 和 npm
-
npm 命令指定了安装源代码
-
nrm 安装和使用 - 管理 npm 源代码
-
npm、yarn 查看源代码和更改源代码