惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
Y
Y Combinator Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
M
MIT News - Artificial intelligence
Last Week in AI
Last Week in AI
V
V2EX
腾讯CDC
F
Fortinet All Blogs
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19)
Nodejs 相关的一些安装问题
微信公众号 · 2018-09-10 · via 陈少文的网站

1. node-sass 安装

安装 node-sass 时,在 node scripts/install 阶段会从 github.com 下载 .node 文件,由于网络问题,常常会导致失败。

可以在项目内添加一个 .npmrc 文件,配置代理安装:

1
2
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org

或者使用 cnpm 安装

1
2
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install node-sass

2. node-gyp 安装

node-gyp 是为 Nodejs 编译 C++ 扩展,使用的编译工具。这里 有详细的各个系统上的安装方法。

在 Windows 下:

  • 安装 node-gyp:
1
npm install -g node-gyp
  • 配置 Python2.7 以及 VC ++ build Tools 依赖。
1
npm install --global --production windows-build-tools

在进行编译构建时,node-gyp 会自动从国外服务器下载需要的依赖。

如果嫌下载速度慢,也可以自行下载应用包。安装之后,通过 npm config set python python2.7npm config set msvs_version 2015 命令配置。

3. 更换 Nodejs 版本之后,需要重建缓存

1
2
3
4
5
6
7
8
npm cache clean --force
npm update

/data/node8/bin/eslint -> /data/node8/lib/node_modules/eslint/bin/eslint.js
/data/node8/bin/npm -> /data/node8/lib/node_modules/npm/bin/npm-cli.js
/data/node8/bin/npx -> /data/node8/lib/node_modules/npm/bin/npx-cli.js
+ eslint@5.5.0
+ npm@5.10.0