Cannot run on Ubuntu 12.10 #106

Closed
fanweixiao opened this Issue Mar 15, 2013 · 9 comments

Projects

None yet

8 participants

@fanweixiao
cc@cchp:n(master)$ node -v
v0.8.20
cc@cchp:n(master)$ npm -v
1.2.11
cc@cchp:n(master)$ n

/usr/local/bin/node

  ο 0.8.20 

/usr/local/bin/n: 177: read: Illegal option -s



/usr/local/bin/node
/usr/local/bin/n: 244: /usr/local/bin/n: cannot create /usr/local/n/versions/.prev: Is a directory
cp: cannot stat `/usr/local/n/versions/0.8.20/*': No such file or directory

I changed sh to bash to solve Illegal option -s issue. but I don't know how to solve error n:244

@xenyou

This also occured on my Ubuntu machine(12.04). And I found the cause of it.
Because ubuntu's sh is not bash. It's dash.
dash's read command doesn't support -s option.

If it's needed I'll write a patch for this.

@akamensky

I have slightly different case. Maybe also difference in shell application:

$ sudo n 0.9.0

    install : 0.9.0

Error: invalid version 0.9.0
@xenyou

That's not related to this issue.
Your error is just 404.

See these directories. v0.9.0 lacks some archives.
http://nodejs.org/dist/v0.9.0/
http://nodejs.org/dist/v0.9.1/

@akamensky

@xenyou

Maybe then worth to add to output in this case, because it is not obvious what happened.
However, it worked with another version (0.9.3) as a charm, thanks for your info.

@ahildoer

+1

root@ubuntu-dev:~/node-v0.8.22# n
/usr/local/bin/node

    0.10.1
    0.8.18
    0.8.21
  ο 0.8.22

/usr/local/bin/n: 177: read: Illegal option -s
/usr/local/bin/node
root@ubuntu-dev:~/node-v0.8.22# uname -a
Linux ubuntu-dev 3.5.0-25-generic #39~precise1-Ubuntu SMP Tue Feb 26 00:07:14 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu-dev:~/node-v0.8.22# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:   precise
root@ubuntu-dev:~/node-v0.8.22#
@mike-spainhower

👍

Same deal on saucy (13.10)

@cmbuckley

In later versions of Ubuntu, sh is dash, not bash. Workaround is to change the hashbang:

#!/usr/bin/env bash
@medimatrix medimatrix added a commit that referenced this issue Jan 30, 2014
@medimatrix medimatrix Make n use bash
On some systems, the default shell is not bash. This commit fixes issue #106
a661ee1
@medimatrix

This issue has now been resolved as my pull request has been merged.

@tj
Owner
tj commented Jan 31, 2014

should have fixed this a long time ago sorry about that :D thanks for the reminder @medimatrix

@tj tj closed this Jan 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment