short version
why fail run global module code if cmd extension not specified? how can fix without changing launching code?
d:\temp\supertemp>node --version v0.12.4 d:\temp\supertemp>phantomjs --version 1.9.8 d:\temp\supertemp>phantomjs.cmd --version 1.9.8 d:\temp\supertemp>node -e "var res=require('child_process').spawnsync('phantomjs',['--version']); console.log(res.stdout+'', res.error);" null { [error: spawnsync enoent] code: 'enoent', errno: 'enoent', syscall: 'spawnsync' } d:\temp\supertemp>node -e "var res=require('child_process').spawnsync('phantomjs.cmd',['--version']); console.log(res.stdout+'', res.error);" 1.9.8 undefined d:\temp\supertemp> full version
there globally installed module, example phantomjs
npm install -g phantomjs npm have added file starting module command line
%appdata%\npm\phantomjs.cmd the corresponding folder specified in %path% enviroment variable. module can launched folder:
d:\temp\supertemp>phantomjs phantomjs> ^cterminate batch job (y/n)? ^c the problem occures when try lunch nodejs code:
{ '0': { [error: spawn phantomjs enoent] code: 'enoent', errno: 'enoent', syscall: 'spawn phantomjs', path: 'phantomjs' } } last time saw problem in own code , solved via explicit extension specifiing: launching phantomjs.cmd works fine, , phantomjs fails. remind, both ways fine if stating console.
now problem happend inside of installed module html-inspector.
how can solve problem without changing module's sources?
Comments
Post a Comment