Reputation: 1505
Is there a step-by-step process to change a react-native project from using yarn as the package manager to using npm? All I can find after several days of searching are instructions to go from npm to yarn and a package called deyarn which doesn't seem to fully work for me. Does anyone have a good resource on this?
Upvotes: 28
Views: 44046
Reputation: 1
You don't need to do anything just run npm start cmd then follow the same step as suggest.
I've covert my yarn project To npm see the image.
hope is work for you. thanks happy coding.
Upvotes: 0
Reputation: 4103
Try this :
yarn.lock
(don't need this file).node_modules
package.json
, change script use yarn to the same command with npm
yarn
(don't need to remove if you want to use npm
for one project)yarn
if you don't want to use it again.npm
(if you installed, ignore this step)Can you upload some error
, you said that not fully work
.
Edit:
If you want to change npm
to yarn
, it same:
package-lock.json
(don't need this file).node_modules
package.json
, change script uses npm
to the same command with yarn
npm
(don't need to remove if you want to use yarn
for one project)npm
if you don't want to use it again.yarn
(if you installed, ignore this step)You can see CLI commands comparison for 3rd step
Upvotes: 57
Reputation: 1218
The deyarn package worked brilliantly for me.
Note that it will only flag (not auto-update) any package-lock.json scripts that you may need to update.
Depending on your environment needs, you may also want to strip out the engines: yarn: '..'
entry it adds to your package-lock.json.
Upvotes: 5
Reputation: 383
You can try taking the following steps:
node_modules
npm install
This should work because npm and yarn use the same package.json.
Upvotes: 9