0
0

More than 1 year has passed since last update.

[node.js] If you are behind a proxy, please make sure that the network 'proxy' config is set properly. の解決例

Posted at

どんなエラー?

npm installしようとしたら下記のようになりました。

ターミナル
% docker-compose exec web npm install

npm notice 
npm notice New patch version of npm available! 8.1.0 -> 8.1.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.2
npm notice Run npm install -g npm@8.1.2 to update!
npm notice 
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/@babel%2fruntime: Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-11-03T10_45_55_391Z-debug.log

原因

確証はないのですが下記のどちらかが原因だったと思われます

・コンテナの外からdocker-compose exec web npm installを実行したため第三者とみなされ、権限が必要な部分のinstallができなかった(外からならsudoが必要だった)

・ネット環境が弱すぎて、ネットワークエラーをproxiesエラーと判断された(300kbps程度だった)

解決した方法

docker exec -it laravel-fargate-app-web-1 shしてからnpm installした(おそらくroot権限で実施した)

・通信状況が良い時間帯に再度行った(170Mbps程度)

参考にさせてもらった記事

0
0
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
0
0