This article mainly elaborates the method and the step that installs the Zeromq.js in the offline environment. Zeromq.js:
Https://www.npmjs.com/package/zeromq or
Https://github.com/zeromq/zeromq.js
Due to LAN network limitations, plus the installation instructions on GitHub are too simple, it can only be installed after the successful installation of the networked machine and then uploading the node_mudules to the LAN server.
Prerequisites: Node has been installed, g++ more than 4.8, PYTHON2.7,ZEROMQ 4.1.6 has been installed, networking environment and LAN environment best consistent, otherwise there will be unexpected errors.
The following two steps are mainly divided into:
#联网情况下:
Using the system installed ZMQ installation, pre-set two variables, that is, specify the system's original ZMQ installation path (Zeromqdir for the actual ZEROMQ installation path) header files and dynamic library path, etc.:
Export cxxflags= "-I $ (readlink-f zeromqdir/include)"
Export ldflags= "-L $ (readlink-f zeromqdir/.libs)-wl,-rpath=$ (readlink-f zeromqdir/.libs)"
Execute command: NPM install--zmq-external, will print the appropriate information after successful installation.
Package The node_mudules after the execution is finished. Tar zcvf node_modules.tar.gz node_mudules/
#移植到内部网
Prerequisites: Node has been installed, g++ more than 4.8, Python2.7.
Upload and unzip the node_modules.tar.gz, modify the relevant files, and then compile the Zmq.node dynamic library, you need to modify the relevant files:
Enter the Node_modules/zeromq/build directory, edit the makefile, modify the original wrong node path, edit the zmq.target.mk, and modify the same
Node's include path, otherwise it will error. Modify the Nodedir item in the Config.gypi file as the actual path and delete all files under the original release directory.
Using the system installed ZMQ installation, pre-set two variables, that is, specify the original ZMQ installation path of the system header file and the path of the dynamic library, etc.:
Export cxxflags= "-I $ (readlink-f zeromqdir/include)"
Export ldflags= "-L $ (readlink-f zeromqdir/.libs)-wl,-rpath=$ (readlink-f zeromqdir/.libs)"
Then execute the make command in the build directory, and the installation succeeds, and you can see that the Zmq.node file is generated in the release directory, which is a dynamic library and can be seen by the LDD command linked to
ZMQ Dynamic Library of the system.
Linux under Zeromq.js installation