Ok you need to do the following
- Open
/etc/bash.bashrc - Add a line
export NODE_PATH="/usr/local/lib/node"to the end of the file
Note. . If you are editing a file with a graphical program, always use gksudoinstead sudo, otherwise you may get files that do not belong to root, root
Now Node will look for modules in /usr/local/lib/node(create it if it does not exist, you also need to start a new bash, since bashrc is read only at startup), the next step is to put it there.
- Get a repo by either downloading it or cloning it
- Copy the folder
o3-fastxmlfrom node-o3-fastxml/libto /usr/local/lib/nodeso that you have a folder/usr/local/lib/node/o3-fastxml - Make sure the files are owned by root, but can be read by everyone else.
, Node , :
require('o3-fastxml')
, , :)
, .