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?
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.
Merci Jean-Baptiste, je marque ta réponse ;)
;) Pas de soucis avec plaisir.
Hello Jean-Baptiste merci pour ton tips c'est très utile
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
Hello Souleimane tu peux faire ceci :
npm init
npm install create-react-app
npx create-react-app myapp
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)
J'ai écris:
npx create-react-app
Et ca marche, est ce que c'est grave si je n'écrit pas le:
--version-scripts...
?
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.
Ok c'est pas grave, merci je vais essayer de me débrouiller avec (ou plutôt sans 😂 ), 👍
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
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.