I created the app wiyh npx-create-app, yarn start workes well. But when I try to install React-bootstrap and marked with Yarn:
yarn add react-bootstrap bootstrap
yarn add marked
The modules doesn't appeared in the package.json file. Doesn't worked.
This is the console:
Then I tried with npm :
npm install react-bootstrap bootstrap
npm install marked
That's worked well.
Why that's doesn't work with yarn ?
I tried also to make yarn install before but the console displayed "info No lockfile found". So I'm litle confused with yarn. What I have to do, in which order ?
Related
This is what I'm getting
I am not able to create a project using create-react-app, I get the error "Module not found".
Node version is 17.0.1 and Npm version is 8.1.1
I have reinstalled nodejs 3 times now and have tried different commands like
npm install create-react-app -g
npm cache clean --force
P.S - I have updated the nodejs to 17.0.1 as the picture version shows 16.13.0
You can try with npx create-react-app my-app.
Visit for more details create-react-app
To create a new app, you may choose one of the following methods:
npx
npx create-react-app my-app
npm
npm init react-app my-app
npm init <initializer> is available in npm 6+
Yarn
yarn create react-app my-app
yarn create is available in Yarn 0.25+
So after almost 3-4 hours of trying different things, it has worked.
I dont know which particular thing would have helped it to work but following are the things I tried -
Delete npm and npm cache folder.
Reinstall the nodejs (LTS version).
Create the app in another folder.
Used power shell instead of CMD.
npm fix
npm fix --force
I already uninstalled yarn but when I run node package execute (npx) create-react-app, yarn lock is still there but i can run it with node package manager (npm) start. How can I get I back to package-lock json or npm version when i create-react-app using npx create-react-app.
I wanna use npm for react and react-native projects.
Just delete the yarn.lock and run npm install and it will generate a package-lock.json.
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. https://docs.npmjs.com/cli/v7/configuring-npm/package-lock-json
I've been trying to do yarn install and yarn to a project from work but for some reason it keeps displaying the same message and I can't delete the #tspnm/uikit because it's being used in many places.
The node version is 15.13.0
yarn version 1.22.5
and npm version 7.7.6.
I've tried doing yarn cache clean and then yarn and still the same, I've also tried deleting the yarn.lock file and got the same result.
Remove the legacy react-native-cli
npm uninstall -g react-native-cli
Install new one from "react-native-community":
npm i -g #react-native-community/cli
after that, init the Project with:
npx react-native init MyApp --template react-native-template-typescript
I am trying to use sass in my reactjs project and I tried
npm install node-sass
after install and import it with scss extension but not working it,
I used W3Schools Tutorial but still not working
error showing this
./src/myStyle.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-5-4!./src/myStyle.scss)
To import Sass files, you first need to install node-sass.
Run `npm install node-sass` or `yarn add node-sass` inside your workspace.
The error is:
Run npm install node-sass or yarn add node-sass inside your workspace.
This means that the node-sass was not found inside the node_modules folder of the reactjs project.
This problem can be fixed by explicitly installing node-sass inside the project folder (using --save option along with npm install inside the project folder)
cd react-js-project-folder
npm install --save node-sass
npm install --save node-sass must be run in the root of the react-js project, I.E., at the same folder where package.json is located.
I have cloned a react js project from Github to my local,
After giving 'npm start' i am getting the below error
./src/index.js
Module not found: Can't resolve '#material-ui/core/styles' in 'C:\Users\Goodwork\desktop\xxxxxxxxxxx\src'
After cloning do npm install to download dependencies. run below command.
npm install
then run project
npm start
NOTE: if your package.json don't have #material-ui/core in dependencies list then you may have to install it.
run this command.
npm install #material-ui/core