3
1

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 3 years have passed since last update.

WSL プロキシ配下でnpxコマンドを実行する

Posted at

プロキシ配下の場合、npm -g config set でプロキシの設定をしていても、
npx create-react-app my-app
を実行すると、
npm ERR! FetchError: request to https://registry.npmjs.org/create-react-app failed, reason: connect ECONNREFUSED
といったエラーになってしまう。
どうやらnpmの設定を見ていない模様。

そこで、
npx --userconfig /home/${USER}/.nvm/versions/node/v12.18.4/etc/npmrc create-react-app my-app
のように、npmの設定ファイルを明示的に指定すれば良い。

なお、設定ファイルの場所は、
npx create-react-app my-app
で表示される。

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?