0
0

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.

NPMのコマンドが401になる

Posted at

環境

Angular CLI:11.2.14
Node:16.4.2
OS:win32 x64
Angular:11.2.14

現象

npm i, npm uninstall, npm cache cleanなどnpmコマンドが使えない
👉angularとNodeのバージョンが一致していないのが原因
Angular CLIとNode.jsのバージョン対応表
nodeのバージョンを上げ方

  1. nvm-windowsがなければインストールする
    nvm(Node Version Manager)でWindowsにNode.jsをインストールする
  2. Nodeのバージョンを上げる
    node.js のバージョンを切り替えて使う(nvm-windows)
    コマンドプロンプトを管理者で実行しないとバージョンの変更ができないので注意

ここまででnpm uninstallはできるようになった
まだ401が出るので、.npmrcで指定しているURLで401だったので以下を実行。

vsts-npm-auth -config .npmrc

最初のコマンドが全部使えるのが確認できた

そのほか参考
Update vsts-npm-auth with new username and password

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?