Issue
just cleaned out some files off my computer. idk what I'm missing
LambdaSr167sMBP:~ lambda_school_loaner_167$ yarn add create-react-app
yarn add v1.22.4 info No lockfile found. warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files.
To clear this warning, remove package-lock.json.
[1/4] 🔍 Resolving packages... warning [email protected]: Use pkg.json instead. warning create-react-app > tar-pack > [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages... error /Users/lambda_school_loaner_167/node_modules/node: Command failed. Exit code: 1 Command: node installArchSpecificPackage Arguments: Directory: /Users/lambda_school_loaner_167/node_modules/node
Output: npm ERR! code MODULE_NOT_FOUND npm ERR! Cannot find module './lib/replace.js' npm ERR! Require stack: npm ERR! - /usr/local/lib/node_modules/npm/node_modules/tar/index.js npm ERR! - /usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js npm ERR! - /usr/local/lib/node_modules/npm/node_modules/pacote/extract.js npm ERR! - /usr/local/lib/node_modules/npm/node_modules/pacote/index.js npm ERR! - /usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js npm ERR!
- /usr/local/lib/node_modules/npm/lib/install/deps.js npm ERR! - /usr/local/lib/node_modules/npm/lib/install.js npm ERR! - /usr/local/lib/node_modules/npm/lib/npm.js npm ERR! - /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm ERR! A complete log of this run can be found in: npm ERR! /Users/lambda_school_loaner_167/.npm/_logs/2021-09-22T00_33_35_034Z-debug.log internal/modules/cjs/loader.js:796
throw err;
^
Error: Cannot find module 'node-darwin-x64/package.json' Require stack:
- /Users/lambda_school_loaner_167/node_modules/node/installArchSpecificPackage.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
at Function.resolve (internal/modules/cjs/helpers.js:80:19)
at ChildProcess.<anonymous> (/Users/lambda_school_loaner_167/node_modules/node-bin-setup/index.js:18:27)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) { code: 'MODULE_NOT_FOUND', requireStack: [
'/Users/lambda_school_loaner_167/node_modules/node/installArchSpecificPackage.js' ] }
Solution
Your command yarn add create-react-app
is not a valid one
follow the official documentation for creating your react app : https://create-react-app.dev/docs/getting-started
example if you alreay have node & yarn installed you need to run
yarn create react-app <yourappnamehere>
(note that there is no -
between create and react-app)
You can also create your app using npx like : npx create-react-app <yourappnamehere>
Answered By - Rimaz Mohommed