web-dev-qa-db-ja.com

作成Reactアプリがインストールされず、エラーが表示されてインストールが中止されます

Node.jsとYarnを再インストールしました。現在、このエラーが発生しています。

私の環境情報は:

ノード:v8.12.0

NPM:6.4.1

糸:1.10.1

OS:Windows 10

PS C:\Users\mdbel\Desktop\Project\redux> npx create-react-app learnredux

Creating a new React app in C:\Users\mdbel\Desktop\Project\redux\learnredux.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.1.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\mdbel\\Desktop\\Project\\redux\\learnredux\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\mdbel\Desktop\Project\redux\learnredux has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
5
Belal

.npmrcからC:\Users\you\.npmrcを削除することでも問題を解決できます。

2
Belal

から最新バージョンのノードをインストールして問題を解決しました

https://nodejs.org/en/download/

そして、以下のコマンドを実行します

npm install -g create-react-app

ターミナルで「create-react-app」または「create-react-app」が続きます。すでにフォルダにいる場合。

同じ問題が発生した後、以下のコマンドを実行すると問題が解決しました

npm cache clean --force

上記のコマンドで問題が解決しなかった場合は、以下のコマンドを試してください。

npm init -y
npx create-react-app your-app-name
1

ノードモジュールをバージョン13.12.0にアップデートして、私にとってはうまくいく

https://nodejs.org/es/download/current/

0
Mario

これを試して!

npm install -g npm @ latest

npmインストールノード

npm install -g糸

npx create-react-app appname

cd firstapp

糸スタート

0
Abhilasha