![](https://img-blog.csdnimg.cn/20201014220858987.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
npm
npm相关
勇敢的阿呆
该奋斗的年纪,不要选择安逸。
展开
-
npm查看已安装的包(全局、和本地)
查看全局已安装查看全局已安装(-g 的意思是 global 全局的意思)$ npm list -g会发现,会把包的所有依赖也显示出来加上层级控制显示深度:--depth 0$ npm list -g --depth 0这样就只会查到安装的包,并不会查到包的依赖。查看项目中已安装查看当前项目已安装包(项目跟目录必须有 package.json 文件)$ npm list同样也是会把所有包的依赖显示出来。同上,加上 --depth 0 就好了。$ npm list --depth原创 2021-12-08 17:54:31 · 39468 阅读 · 0 评论 -
npm清除缓存
npm 版本在 7.0.0 以上则不需要清除缓存。# npm version < 7.0.0$ npm cache clean -f# npm version ≧ 7.0.0 会报以下错误$ npm cache cleannpm ERR! As of npm@5, the npm cache self-heals from corruption issuesnpm ERR! by treating integrity mismatches as cache misses. As a原创 2021-12-08 17:52:47 · 35112 阅读 · 0 评论 -
发布属于自己的npm包
什么是 NPM发布教程1. 去 NPM 官网注册账号2. 初始化项目$ npm initThis utility will walk you through creating a package.json file.It only covers the most common items, and tries to guess sensible defaults.See `npm help init` for definitive documentation on these field原创 2021-07-25 15:51:21 · 131 阅读 · 0 评论 -
npm安装包时太慢怎么办?使用淘宝镜像站 or 切换官方镜像站
当使用 npm install <package> 时,由于 NPM 默认镜像站是在国外的原因,会导致下载速度非常慢,甚至下载失败。可以切换为国内的 淘宝镜像站临时使用(仅对本次有效)npm install <package> --registry https://registry.npm.taobao.org/长期使用(推荐,如果需要 发布 NPM 包 的话,不能使用这种配置,需要改回原镜像源)npm config set registry https://regist原创 2021-07-25 15:18:28 · 1565 阅读 · 0 评论 -
CentOS 安装 NodeJS
Step 1拉取 Node 的 repo 源(示例版本为 12.x LTS)其他版本$ sudo curl -sL https://rpm.nodesource.com/setup_lts.x | bash -执行完以上内容之后,会在 /etc/yum.repo.d/ 目录下出现一个名为 nodesource-elx.repo 的文件。Step 2安装$ yum install nodejs...原创 2020-09-27 15:35:02 · 142 阅读 · 0 评论