Daily harvest
  • Introduction
  • First Chapter
  • vue初次尝试
  • Chrome Performance Tools
  • React
    • react摸索之context
    • ant design 自定义form双向绑定组件
  • Npm
    • 【译】如何防止权限错误
    • Npm-rebuild
  • 基础概念
    • my blind spot of console.log()
    • 从别人那儿新学到的关于 require 和 import 的隐藏知识
    • LRUCache.ts
    • foobar variables
  • Nodejs
    • 【译】使用JSON Web Tokens保护Node.js的RESTful Api
  • Tools
    • 新学到的linux命令
    • webstorm eslint8 报错
  • Python
    • Mac python 虚拟环境
  • Algorithm
    • LeetCode 第 1 题
Powered by GitBook
On this page

Was this helpful?

  1. Npm

Npm-rebuild

Previous【译】如何防止权限错误Nextmy blind spot of console.log()

Last updated 5 years ago

Was this helpful?

日常开发中 经常遇见npm install失败后再怎么install都不成功问题,在那儿install磨叽半天 么得结果,有一天队友上来一个命令教做人了,那就是npm rebuild。那这样就得来看rebuild是什么操作了。 使用:

npm rebuild [[@scope/name]...]

官方是这样说的:

This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.

意思就是rebuild命令其实是在相应的目录运行了一下build命令(这不废话么,re-xxx不就是重复做xxx事么)。当你安装了新版本的node时,必须重新编译C++依赖。

所以最常见的场景是切换node版本时。

参考:

npm-rebuild