「npm install」を全てcmdで行ってはいけない話
いつものように本番環境ではどのように動くのか試したかったので、以下のコマンドを打つと
firebase deploy
update ~ npm i -g firebase-tools
的なことを書かれたのでいざ実行するとエラーが発生
npm i -g firebase-tools
npm ERR! The operation was rejected by your operating system.
npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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 (though this is not recommended).
npmのエラーは厄介だからこれは時間がかかると思い、案の定2,3時間くらい時間を費やした。
要するに権限が無いよと言う意味。
色々調べてみると、本来ならC:\Program Files (x86)\nodejs(自分で設定したファイル名)\etc
というフォルダがあるはずなのだが無かった。
なので、一度npm
のバージョンアップデートしてみる。
npm i npm@latest
そうすると、無事インストールが完了しetc
フォルダも作成された。
そして同じようにfirebase-tools
を実行すると同じようなエラーが発生😨
npm i -g firebase-tools
npm ERR! The operation was rejected by your operating system.
npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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 (though this is not recommended).
このことから、なんでもGitBashでインストールしてはいけないんだなと思った。
なので、Windowsの「Powershell」を「管理者として実行する」とfirebase-tools
をインストールしてみると無事インストールされた!
いや~長かった。
npmのエラーは嫌いです!
以上、「「npm install」を全てcmdで行ってはいけない話」でした!
良ければ、LGTM、コメントお願いします。
また、何か間違っていることがあればご指摘頂けると幸いです。
他にも初心者さん向けに記事を投稿しているので、時間があれば他の記事も見て下さい!!
Thank you for reading
Author And Source
この問題について(「npm install」を全てcmdで行ってはいけない話), 我々は、より多くの情報をここで見つけました https://qiita.com/akki-memo/items/a84dd373ca38292ba11a著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .