I'm installing a new react app using nextjs docs:
npx create-next-app
for some reason its using yarn by default:
I'm used to working with npm commands, how can I fix it please ?
EDIT: npx create-next-app my-app --use-npm
https://github.com/vercel/next.js/issues/10647
OLD ANSWER:
Remove yarn.lock
and node_modules/
rm yarn.lock
rm -rf node_modules
install your dependencies with npm:
npm install
this will create a package-lock.json
file, analogous to yarn.lock
.
node_modules
, wont it delete all the modules nextjs is using ? I've seen on youtube people using npx ...
and the instalation used npm and not yarn..
Jun 28, 2020 at 15:11
npm install
will read package.json
and install the libraries listed in dependencies
. Just don't delete package.json
.
Jun 28, 2020 at 15:31
I tried the answer by @Rodrigo Amaral but faced several errors.
Before deleting the node_modules and yarn.lock, I ran npm install, which created a package-lock.json.
So the workflow is
npm install
rm yarn.lock
rm -rf node_modules
npm install
This should work.