In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how to achieve offline installation of the global node module", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install the global node module offline" this article.
Preparatory work
Installation environment: MacOS
Since it is an offline installation, the corresponding module needs to be downloaded through the network first. In this article, the asar module and its dependencies are downloaded through npm install-D asar. The file structure is as follows:
Offline installation of global asar
The principle of method 1 is the same as we install the node module online, directly through the npm intall-g XXX.
First, we create a new node_modules folder under the asar folder, and move all the folders under test/node_modules except .bin and asar to the test/node_modules/asar/node_modules folder, as shown below:
Execute the following command at the terminal (the path is the absolute path of test/node_modules/asar):
Npm install-g / Users/code/test/node_modules/asar copy code
Then execute asar-V in any terminal to verify that the installation is successful, and the results are as follows:
Indicates that the asar module has been successfully installed and is done!
Matters needing attention
On MacOS, the global module installed by this method only generates a soft connection to the global instruction, which is verified as follows:
Execute where asar to get the result:
Then go to the path / usr/local/bin/asar to find asar and view its properties:
Therefore, do not delete or rename the test/node_modules/asar/ file path, otherwise it will invalidate the global asar!
Under windows, after using this method, the entire asar folder is completely copied to AppData/Roaming/npm/node_modules, and deleting the original asar folder does not affect the use.
The above is all the contents of the article "how to install the global node module offline". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.