Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation problem on Mac OS #123

Closed
willwangcc opened this issue Oct 31, 2017 · 11 comments
Closed

installation problem on Mac OS #123

willwangcc opened this issue Oct 31, 2017 · 11 comments

Comments

@willwangcc
Copy link

I can use my node globally, but I don't know why there a message about "node: command not found"

Below is what I do:
`~ git:master ❯ sudo npm install -g ijavascript ✹ ✭

⸨ ░░░░░░░░░░░░░░░░░⸩ ⠦ fetchMetadata: sill resolveWithNewModule string_decoder@
/usr/local/bin/ijsconsole -> /usr/local/lib/node_modules/ijavascript/bin/ijsconsole.js
/usr/local/bin/ijs -> /usr/local/lib/node_modules/ijavascript/bin/ijavascript.js
/usr/local/bin/ijsinstall -> /usr/local/lib/node_modules/ijavascript/bin/ijsinstall.js
/usr/local/bin/ijskernel -> /usr/local/lib/node_modules/ijavascript/lib/kernel.js
/usr/local/bin/ijsnotebook -> /usr/local/lib/node_modules/ijavascript/bin/ijsnotebook.js

[email protected] install /usr/local/lib/node_modules/ijavascript/node_modules/zeromq
node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)

sh: node: command not found
sh: node: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wangzhixiang/.npm/_logs/2017-10-31T05_07_45_178Z-debug.log`

@willwangcc
Copy link
Author

willwangcc commented Oct 31, 2017

~ git:master ❯ open /Users/wangzhixiang/.npm/_logs/2017-10-31T05_07_45_178Z-debug.log

1519 verbose pkgid [email protected]
1520 verbose cwd /Users/wangzhixiang
1521 verbose Darwin 16.7.0
1522 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ijavascript"
1523 verbose node v8.5.0
1524 verbose npm v5.5.1
1525 error file sh
1526 error code ELIFECYCLE
1527 error errno ENOENT
1528 error syscall spawn
1529 error [email protected] install: node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)
1529 error spawn ENOENT
1530 error Failed at the [email protected] install script.
1530 error This is probably not a problem with npm. There is likely additional logging output above.
1531 verbose exit [ 1, true ]

@n-riesco
Copy link
Owner

The command sudo npm install -g ijavascript installs IJavascript globally (for all the users in your computer). This requires that node is also installed globally.

If you want to install IJavascript only for your user, see the instructions here.


To confirm that node isn't accessible by your root user, please, run the following command:

$ sudo which node || echo Not found
Not found

@willwangcc
Copy link
Author

willwangcc commented Oct 31, 2017

I tried the command and it showed that I can use node globally.

$ sudo which node || echo Not found                     
/usr/local/bin/node
$ ❯ sudo node                                                    
> console.log("Hello")
Hello
undefined
> 

@willwangcc
Copy link
Author

willwangcc commented Oct 31, 2017

Thanks, @n-riesco, It works. I think that it is not about 'node'.
I do as http://n-riesco.github.io/ijavascript/doc/install.md.html#local-installation shows.
I missed one command conda install nodejs.

Before: I did as Gihub Installation asked.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install pkg-config node zeromq
sudo easy_install pip
sudo pip install --upgrade pyzmq jupyter
sudo npm install -g ijavascript

After: I do as http://n-riesco.github.io/ijavascript/doc/install.md.html#local-installation shows.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install pkg-config node zeromq
sudo easy_install pip
sudo pip install --upgrade pyzmq jupyter
conda install nodejs  
sudo npm install -g ijavascript

@n-riesco
Copy link
Owner

@WillWang-X Oh... so you've installed Anaconda, haven't you?

I'm happy to hear it's working for you.

I'm going to reopen the issue to remind me to check the installation instructions for mac.

@n-riesco n-riesco reopened this Oct 31, 2017
@chrisVillanueva
Copy link

chrisVillanueva commented Nov 17, 2017

I have the same issue as @WillWang-X .
I'm on macHighSierra 10.13.1

I have nodejs and npm installed:

christophers-MacBook-Pro:~ christophervillanueva$ node --version
v9.2.0
christophers-MacBook-Pro:~ christophervillanueva$ npm --version
5.5.1

All installation steps in the README work until the last command;
christophers-MacBook-Pro:~ christophervillanueva$ sudo npm install -g ijavascript
Password:
/usr/local/bin/ijs -> /usr/local/lib/node_modules/ijavascript/bin/ijavascript.js
/usr/local/bin/ijsconsole -> /usr/local/lib/node_modules/ijavascript/bin/ijsconsole.js
/usr/local/bin/ijsinstall -> /usr/local/lib/node_modules/ijavascript/bin/ijsinstall.js
/usr/local/bin/ijskernel -> /usr/local/lib/node_modules/ijavascript/lib/kernel.js
/usr/local/bin/ijsnotebook -> /usr/local/lib/node_modules/ijavascript/bin/ijsnotebook.js

[email protected] install /usr/local/lib/node_modules/ijavascript/node_modules/zeromq
node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)

prebuild-install info begin Prebuild-install version 2.3.0
prebuild-install info looking for local prebuild @ prebuilds/zeromq-v4.6.0-node-v59-darwin-x64.tar.gz
prebuild-install WARN install EACCES: permission denied, access '/Users/christophervillanueva/.npm'

fs.js:905
return binding.mkdir(pathModule.toNamespacedPath(path),
^

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ijavascript/node_modules/zeromq/zmq'
at Object.fs.mkdirSync (fs.js:905:18)
at Object. (/usr/local/lib/node_modules/ijavascript/node_modules/zeromq/scripts/preinstall.js:89:8)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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 [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/christophervillanueva/.npm/_logs/2017-11-17T02_08_30_334Z-debug.log

Any suggestions?

@n-riesco
Copy link
Owner

@chrisVillanueva I've open a new issue to track your problem. See #124

@n-riesco
Copy link
Owner

Closing this issue since I've opened issue #126 to track any updates needed to the installation instructions on Mac.

@adeelshahid
Copy link
Contributor

since #126 is closed as well, anyone ending up here. Just remove sudo from the above commands and it should fix the problem

pip install --upgrade pyzmq jupyter
npm install -g ijavascript

@ilonabudapesti
Copy link

This is still an issue on OS X High Sierra 10.13.6 today. I had node and npm available to all users but still got errors

gyp ERR! configure error
gyp ERR! stack Error: Command failed: /anaconda/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", 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 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ijavascript/node_modules/zeromq
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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 [email protected] install script.

Running conda install nodejs fixed the issue. Then npm install -g ijavascript.

@n-riesco
Copy link
Owner

n-riesco commented Oct 8, 2018

@ilonabudapesti Judging by the error message, it looks like you were affected by #165.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants