n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.18k stars 187 forks source link

Error installing ijavascript in Mac OS Sierra #193

Closed YousangKwon closed 2 years ago

YousangKwon commented 5 years ago

Hi, I'm having problem installing ijavascript. After npm install -g ijavascript; command, It shows some error as such: gyp ERR! stack Error: Command failed: /Users/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:289:12) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at maybeClose (internal/child_process.js:962:16) gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:381:11) gyp ERR! stack at Socket.emit (events.js:182:13) gyp ERR! stack at Pipe._handle.close (net.js:606:12) gyp ERR! System Darwin 16.7.0 gyp ERR! command "/User/anaconda3/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/Kwon//lib/node_modules/ijavascript/node_modules/zeromq gyp ERR! node -v v10.13.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zeromq@4.6.0 install: node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild) npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zeromq@4.6.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

How can I fix it? Recently I'm using Mac OS Sierra

1oglop1 commented 5 years ago

I've got this problem too, it's not a problem with MacOS. The problem is that installer is calling legacy code (print statement instead of print() function).

gyp ERR! stack Error: Command failed: /Users/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];

https://github.com/n-riesco/ijavascript/blob/master/doc/install.md#macos

n-riesco commented 5 years ago

Python2 is a requirement to build native modules. Since you're using anaconda3 on a Mac, please, see the instructions in https://github.com/n-riesco/ijavascript/issues/182#issuecomment-484059752 and let me know if they work.


More info in #182 and #183

YousangKwon commented 5 years ago

Python2 is a requirement to build native modules. Since you're using anaconda3 on a Mac, please, see the instructions in #182 (comment) and let me know if they work.

More info in #182 and #183 @n-riesco Thanks for the reply. I'm not sure I did the same as you've mentioned in #182 i've done as below

conda activate npm config set python python2npm install -g ijavascript

However still the same error was shown during the ijavascript installing part.

n-riesco commented 5 years ago

@YousangKwon Would you be able to post the logs? and also the output of running which python2?

bernardo0marques commented 4 years ago

I'm having the same problem as reported in this issue, I'm trying to install it on macOS Mojave, that's what I get.

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/btm/.npm/_logs/2020-02-29T19_04_21_948Z-debug.log

2020-02-29T19_04_21_948Z-debug.log

n-riesco commented 2 years ago

@bernardo0marques I'm sorry I missed your post.