1
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 1 year has passed since last update.

`npm install axios`したら404出たんだけど

Posted at

「よーし、Rails API × Vue.jsで簡単なTodoアプリ的なものを実装しよ」

・・・10分後・・・

「非同期でHTTP通信したいときには一般的にaxiosを使うのね。よーし、インストールしてみよ〜」ポチッと

ターミナル
❯ npm install --save axios            
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@vue%2fvue-loader-v15 - Not found
npm ERR! 404 
npm ERR! 404  '@vue/vue-loader-v15@15.9.8' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@vue/cli-service'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

「ほえ?なんだこれは...最近Vue.jsとやらを触り始めたばかりなんだが...」

結論

結論としてはvue-loader-v15npmregistryからセキュリティ上の理由により削除されたためのようですね〜

Nodeのバージョンを上げるか、yarnコマンドで実行すると上手くいくみたいです。

参照:GitHub Issues

ターミナル
$ yarn add axios

参照:Getting Started -axios-

ターミナル
$ yarn add axios                        
yarn add v1.22.17
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 5 new dependencies.
info Direct dependencies
└─ axios@0.27.2
info All dependencies
├─ asynckit@0.4.0
├─ axios@0.27.2
├─ combined-stream@1.0.8
├─ delayed-stream@1.0.0
└─ form-data@4.0.0
✨  Done in 2.52s.
package.json
"dependencies": {
    "axios": "^0.27.2",
    "core-js": "^3.8.3",
    "vue": "^3.2.13",
    "vue-router": "^4.0.3",
    "vuex": "^4.0.0"
  }

「ふぅ〜、これでゴリゴリ進めていくぞ〜」

設定ファイルをいじるやり方もあるみたいです(記事が少し古いのでなんとも言えません)
参考:npmでのインストールが404エラーになってたが原因はregistryの設定ファイルだった

参考

1
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
1
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?