4
3

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.

Dockerでnpmコマンドをインストールする

Posted at

Dockerを使えばnpmコマンドをすぐに実行できる環境が手に入る。

やり方

npm コマンドを実行したいフォルダまで移動して以下を実行する。Windowsの場合はGit bashで実行するか $(pwd) をカレントのフォルダのフルパスに置き換える必要がある(e.g. /c/Users/username/Documents)。

docker run -it -v $(pwd):/app -w /app node:10.15.0-alpine sh
# 実行したいnpmコマンド
npm init
4
3
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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?