前提
webpackで環境構築をしています。
node.js : v18.9.0
npm : 8.19.1
npmで
> npm install --save-dev babel-loader babel/core babel/preset-env
githubにサインインするためのウィンドウが出てきて、ブラウザからサインインすると、
info: please complete authentication in your browser...eaning logs, removing 2 files npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/babel/preset-env.git npm ERR! git@github.com: Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-09-11T10_19_41_037Z-debug-0.log
というエラーが出力されました。
エラーを見る限りgithubに公開鍵認証でログインで切るようにすればいいんだろうと思い、
> ssh -T git@github.com Hi teamdevapp! You've successfully authenticated, but GitHub does not provide shell access.
となるようにしました。
もう一度babelのインストールを行うと、
ssh -T git@github.com info: please complete authentication in your browser...eaning logs, removing 2 files npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/babel/preset-env.git npm ERR! ERROR: Repository not found. npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-09-11T10_31_43_284Z-debug-0.log
とエラーが返ってきました。
リモートリポジトリにソースがないということでどうすればいいのかよくわかりません。
https://github.com/babel/preset-env
にアクセスしても404エラーになります。
以前npmの違うバージョンで同じコマンドを実行したときにはgithubの認証を求められることはなかったので、そこも謎です。
怪しいと思った
but GitHub does not provide shell access.
この部分は関係するのでしょうか?
検索しても特に改善するような情報は見つけられなかったです。
実現したいこと
こっちが本命
- npm install の時にgithub認証が行われないようにする
もしくは
- github認証からライブラリをインストールできるようにする。
@babel/core や @babel/preset-env の @ をお忘れでは?(なお、babel-loader には不要なはず。)
https://qiita.com/riversun/items/29d5264480dd06c7b9fb#%E3%82%B3%E3%83%A9%E3%83%A0%E5%85%88%E9%A0%AD%E3%81%ABatmark%E3%81%8C%E3%81%A4%E3%81%84%E3%81%A6%E3%81%84%E3%82%8B%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%81%AF%E4%BD%95%E3%81%8B
ありがとうございます。インストールできました。

回答1件
あなたの回答
tips
プレビュー