What’s the difference between npm i -g create-next-app for npx create-next-app?

Asked

Viewed 105 times

0

I created a Next.js project and in the terminal appeared the following:

A new version of create-next-app is available!


You can update by running: npm i -g create-next-app

What is the difference and which is the most recommended?

1 answer

1

There is no "difference". They are different commands, so they have different functions. Therefore it makes no sense to ask which differences and which one is more recommended. Both are equally recommended, only for different functions.

  • The npm i -g create-next-app installs a new version of the program create-next-app.
  • Already the npx create-next-app is used to run the programme itself create-next-app to create a new Next application.

You can check the difference between versions of create-next-app on the page of releases of the Github of the project in question.

Learn more about the npx here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.