101ta28/kit-proxy

`kit-proxy on`の時エラーが起きる。

Closed this issue · 6 comments

  • 動作環境

    • "Ubuntu 22.04.3 LTS" on WSL2。
    • KITプロキシ環境下ではない。
  • エラーログ

$ kit-proxy on
npm ERR! code EPERM
npm ERR! syscall chmod
npm ERR! path /etc/npmrc
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, chmod '/etc/npmrc'
npm ERR!  [Error: EPERM: operation not permitted, chmod '/etc/npmrc'] {
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'chmod',
npm ERR!   path: '/etc/npmrc'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kuro/.npm/_logs/2023-10-18T13_55_17_470Z-debug-0.log
npm ERR! code EPERM
npm ERR! syscall chmod
npm ERR! path /etc/npmrc
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, chmod '/etc/npmrc'
npm ERR!  [Error: EPERM: operation not permitted, chmod '/etc/npmrc'] {
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'chmod',
npm ERR!   path: '/etc/npmrc'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kuro/.npm/_logs/2023-10-18T13_55_17_813Z-debug-0.log
ERROR: [Errno 2] No such file or directory: 'config'
ERROR: [Errno 2] No such file or directory: 'config'

the command again as root/Administratorとなってたので sudoをつけるのかなと思い
sudoで実行してみました。

$ sudo kit-proxy on
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'config'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'config'
Set proxy

エラーログを消したいです。

Set proxyが表示されたということは大丈夫ということでしょうか?

npm でグローバルにプロキシを設定しようとすることで、高い権限が求められ、エラーになっているようです。

利用するユーザーのみにプロキシを設定することによって、解決できるはずです。

npm -g config になっている部分を、 npm config のようにグローバル設定を外せば修正できます。

P.S. @yoshiyuki-140 さん、修正するプルリク立ててみます?気が向かなかったら @101ta28 の方で修正しておきます。

是非やらせていただきたいです。僕のローカルPCでのエラーなので。
待っていただいてありがとうございます。

ご指摘いただいた修正でローカルの環境は治りました。
ありがとうございます!
(`・ω・´)b
編集の規模的にプルリクエストを送らなくてもよいかなと思いました。_
したがって、修正お願いしてもよろしいでしょうか。

うわーどうしよ、やっぱり、プルリクエストの経験ないし。
自分でやりたくなりました。
修正に時間かかると思いますけどやりたいです。
やらせてください。
<(_ _)>

ここで反映しました