Discussions

je n'arrivepas à créer mon dossier en utilisant: npx create-react-app react-formation-ultime --scripts-version 4.0.2

Image

Error: Cannot find module 'C:\Users\PC-SALON\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\xtend\immutable'. Please verify that the package.json has a valid "main" entry et d'autres lignes d'erreur, quelqu'un à eu le même souci?

12 réponses
Image
Jean-baptiste Salmon
Le 20/09/2022 à 03:19

Petite mise à jour après avoir cherché un peu, si  ca peut en aider d'autres personnes:

npx create-react-app@5.0.1 react-formation-ultime --scripts-version 4.0.2 et là, ca fonctionne.

Image
Louis-Nicolas Leuillet
Le 20/09/2022 à 09:55

Merci Jean-Baptiste, je marque ta réponse ;)

Image
Jean-baptiste Salmon
Le 22/09/2022 à 15:20

;) Pas de soucis avec plaisir.

Image
Sébastien Collin
Le 29/03/2023 à 20:01

Hello Jean-Baptiste merci pour ton tips c'est très utile

 

Image
Souleimane Amiche
Le 29/04/2023 à 23:06

Salut Louis-Nicolas moi aussi j'ai une erreur lorsque je lance "create-react-app..." sauf que ce n'est pas la meme que celle de jean-baptiste, voici l'erreur:

C:\Users\Administrateur\Desktop\WebSite\React>npx create-react-app react-formation-ultime --scripts-version 4.2.0
Need to install the following packages:
  create-react-app@5.0.1
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

Creating a new React app in C:\Users\Administrateur\Desktop\WebSite\React\react-formation-ultime.

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

npm ERR! code ETARGET
npm ERR! notarget No matching version found for react-scripts@4.2.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrateur\AppData\Local\npm-cache\_logs\2023-04-29T20_47_22_272Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts@4.2.0 cra-template has failed.

Deleting generated file... package.json
Deleting react-formation-ultime/ from C:\Users\Administrateur\Desktop\WebSite\React
Done.
npm notice
npm notice New patch version of npm available! 9.6.1 -> 9.6.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.5
npm notice Run npm install -g npm@9.6.5 to update!
npm notice
Image
Louis-Nicolas Leuillet
Le 30/04/2023 à 11:36

Hello Souleimane tu peux faire ceci :

npm init
npm install create-react-app
npx create-react-app myapp
Image
Souleimane Amiche
Le 30/04/2023 à 14:45

ca ne fonctionne pas,

C:\Users\Administrateur\Desktop\WebSite\React>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (react) npm install create-react-app
Sorry, name can only contain URL-friendly characters.
package name: (react)
Image
Souleimane Amiche
Le 30/04/2023 à 20:44

J'ai écris:

npx create-react-app

Et ca marche, est ce que c'est grave si je n'écrit pas le:

--version-scripts...

?

Image
Louis-Nicolas Leuillet
Le 01/05/2023 à 15:38

Ce n'est pas grâce mais disons que ça risque de te géner un peu dans l'organisation des fichiers. Je crois que ça n'a pas vraiment changé de toute façon.

Image
Souleimane Amiche
Le 01/05/2023 à 16:29

Ok c'est pas grave, merci je vais essayer de me débrouiller avec (ou plutôt sans 😂 ), 👍

Image
Michael GOUEZ
Le 05/06/2023 à 14:12
D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime>npm start

> react-formation-ultime@0.1.0 start
> react-scripts start

i 「wds」: Project is running at http://192.168.1.150/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\public
i 「wds」: 404s will fallback to /
Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:358:12    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:417:16)
    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:452:10    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\webpack\lib\NormalModule.js:323:13    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\DEV_BELIEVEMY\00BELIEVEMY\09REACT\01PROJET_REACT\react-formation-ultime\node_modules\babel-loader\lib\index.js:59:103 {  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.0

 Bonjour Louis-Nicolas, j'ai bien réussi à installer create-react-app mais je me retrouve avec cette erreur au moment de lancer npm-start.

 

As tu une solution à cette erreur ?

Le serveur localhost:3000 ne fonctionne pas.

 

Merci pour ton retour.

 

Cdt

 

Image
Michael GOUEZ
Le 05/06/2023 à 14:17

Après plusieurs tests, j'ai trouvé la solution il faut modifier le fichier package.json en remplacant ces lignes :

Lignes à modifier :

"start": "react-scripts start",
"build": "react-scripts build",

Modification à faire : 

"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",

 

Le serveur est maintenant opérationnel après un npm-start.

Meilleure réponse
Image
Inscrivez-vous ou connectez-vous pour participer à la discussion.
Discussion résolue

Informations

Créée le 20 septembre 2022 03:00
Dernière activité le 5 juin 2023 14:17