44# Your installation of nodejs with the following packages: mathjax-node svg2png (install them using
55# npm).
66
7- # Tips for installing nodejs on OS X :
8- # see https://gist.github .com/DanHerbert/9520689
9- # export NODE_PATH=/your/path/to/homebrew/bin/node_modules:$NODE_PATH
7+ # Tips for troubleshooting :
8+ # https://docs.npmjs .com/resolving-eacces-permissions-errors-when-installing-packages-globally
9+ # export NODE_PATH=$(npm root --quiet -g)
1010
1111import subprocess
1212from subprocess import Popen
@@ -162,7 +162,7 @@ def _create_client(self):
162162 server_path = os .path .join (
163163 os .path .dirname (os .path .realpath (__file__ )), 'server.js' )
164164
165- if True :
165+ if False :
166166 # fixes problems on Windows network drives
167167 import tempfile
168168 fd , copied_path = tempfile .mkstemp (suffix = 'js' )
@@ -172,7 +172,8 @@ def _create_client(self):
172172 server_path = copied_path
173173
174174 def abort (message ):
175- error_text = 'Node.js failed to startup %s:\n \n ' % server_path
175+ error_text = '\n Node.js failed to start Mathics server.\n '
176+ 'You might need to run: npm install -g mathjax-node svg2png\n \n '
176177 raise WebEngineUnavailable (error_text + message )
177178
178179 process = Popen (
@@ -192,7 +193,7 @@ def abort(message):
192193 error += ' ' + line
193194
194195 process .terminate ()
195- abort (error + ' \n Please check Node.js modules and NODE_PATH' )
196+ abort (error )
196197
197198 port = int (status [len (hello ):])
198199 except OSError as e :
0 commit comments