4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macのローカルにexpressインストールしようとしてハマった

Posted at
$ npm install -g express

でインストールした後に~/.nvm/v0.10.29/lib/node_modulesにはしっかり入っているのにbash: express: command not foundと出て迷走してしまった備忘録。

express 4系ではexpress-generatorを入れないといけない模様。

$ npm install -g express-generator

で問題なく動くようになりました。

$ express myapp
$ cd myapp && npm install
$ DEBUG=myapp ./bin/www
$ open http://localhost:3000

でExpressの画面が出ればひとまず準備完了。

ポートを変える場合は起動する前に下記のように指定してから起動。

export PORT=3001

via: http://stackoverflow.com/questions/23002448/express-command-not-found/23003386#23003386?newreg=e0a4aad84b844532b5c1488c84bfc17a

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?