Home > Software engineering >  All the `Native Node modules` exist in Node.js, why there need to "install Native Node modules&
All the `Native Node modules` exist in Node.js, why there need to "install Native Node modules&

Time:01-18

when I read this document I don't understand,

npm install --save-dev electron-rebuild

# Every time you run "npm install", run this:
./node_modules/.bin/electron-rebuild

before execute ./node_modules/.bin/electron-rebuild, whether we need to install third party package?
like npm install axios?

using-native-node-modules#troubleshooting:

If you installed a native module and found it was not working

  1. if is, this "third party package" is not Native Node modules, right?
  2. as all we know, all the Native Node modules exist in Node.js, why there need to "install Native Node modules" then rebuild it for Electron support?

CodePudding user response:

You are confusing node core modules with native node modules. Native just means the module is written in a compiled language like C and exists as machine code at the end while regular modules exist as Javascript code. An example would be the bcrypt module. Core modules on the other hand are built into node itself and, as you correctly said, therefore won't need to be installed separately, such as fs.

  • Related