Nodejs - .node_libraries/ for www-data

endrien

New Member
I want to use uglifyjs (https://github.com/mishoo/UglifyJS) from my PHP application. UglifyJS is built using Nodejs, so I need a .node_libraries/ dir in my homedir (/home/peppe).I want to execute uglifyjs by shell_exec() in PHP. But where am I supposed to add the .node_libraries/ dir since www-data user doesn't have a home dir?Addition: I solved it. The solution was to set NODE_PATH and execute the command like this in PHP:\[code\]shell_exec('NODE_PATH="/opt/www_node_libraries/"; export NODE_PATH; uglifyjs options filename');\[/code\]
 
Back
Top