SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cannot use Express after installing globally OS X 10.8 Mountain Lion

    I've been trying for the better part of 2 hours now to go through the Jumpstart Node.js book and I'm about ready to just give up. I've tried, countless times, to install express using

    sudo npm install -g express@2.5.8

    and even just the most recent version by removing everything after (and including) the @ symbol. It continues to install just fine, but EVERY time I try to do anything using "express <whatever>" in the terminal, I receive the following message:

    -bash: express: command not found

    I've ben searching all over Google to find a solution and I can't. I'm at my wit's end. I've tried running
    npm link express (with and without sudo)

    and that did nothing. I found a few posts on Stack Overflow about updating my .bash_profile and $PATH and nothing is working. I don't get it. And given the complete lack of topics anywhere about this, it would seem as though there is something I'm just not doing right because if this was a widespread issue, I would've been able to find a solution.

    I'm following the book's instructions exactly but am unable to proceed and I'm about ready to throw my Macbook off my balcony. Any help would be greatly appreciated.

  2. #2
    SitePoint Author
    Join Date
    Nov 2012
    Posts
    48
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Can you post the console output of:

    sudo npm install -g express@2.5.8

    In the meantime, a global install is not strictly necessary. All that

    express XYZ

    does is create a directory with some default files. I have run the command myself and zipped up the output here:

    https://dl.dropbox.com/u/12337149/template.zip

    Let me know how you go

  3. #3
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Don,

    Thanks for the reply. This is the terminal output after running "sudo npm install -g express@2.5.8"

    npm http GET https://registry.npmjs.org/express/2.5.8
    npm http 304 https://registry.npmjs.org/express/2.5.8
    npm WARN engine express@2.5.8: wanted: {"node":">= 0.4.1 < 0.7.0"} (current: {"node":"v0.8.8","npm":"1.1.59"})
    npm http GET https://registry.npmjs.org/mime/1.2.4
    npm http GET https://registry.npmjs.org/connect
    npm http GET https://registry.npmjs.org/qs
    npm http GET https://registry.npmjs.org/mkdirp/0.3.0
    npm http 304 https://registry.npmjs.org/qs
    npm http 304 https://registry.npmjs.org/mime/1.2.4
    npm http 304 https://registry.npmjs.org/mkdirp/0.3.0
    npm http 304 https://registry.npmjs.org/connect
    npm WARN package.json connect@1.9.2 No README.md file found!
    npm http GET https://registry.npmjs.org/formidable
    npm http 304 https://registry.npmjs.org/formidable
    /usr/local/share/npm/bin/express -> /usr/local/share/npm/lib/node_modules/express/bin/express
    express@2.5.8 /usr/local/share/npm/lib/node_modules/express
    ├── qs@0.4.2
    ├── mime@1.2.4
    ├── mkdirp@0.3.0
    └── connect@1.9.2 (formidable@1.0.11)

  4. #4
    SitePoint Author
    Join Date
    Nov 2012
    Posts
    48
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What happens if you try to run

    /usr/local/share/npm/bin/express

  5. #5
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just got this:

    Kyles-MacBook-Pro:~ kkerley$ /usr/local/share/npm/bin/express
    destination is not empty, continue? y

    create : .
    create : ./package.json
    create : ./app.js
    create : ./public/javascripts
    create : ./public/images
    create : ./public/stylesheets
    create : ./public/stylesheets/style.css
    create : ./views
    create : ./views/layout.jade
    create : ./views/index.jade
    create : ./routes
    create : ./routes/index.js
    create : ./public

    dont forget to install dependencies:
    $ cd . && npm install


    ...I don't get it.

  6. #6
    SitePoint Author
    Join Date
    Nov 2012
    Posts
    48
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That actually looks OK. The only thing missing is a directory. For now if you use

    /usr/local/share/npm/bin/express

    anywhere in the book you are supposed to type 'express' into the console you should be able to proceed.

  7. #7
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes...it's working now. Thank you so much, Don!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •