flâneur — a map of the web's best reading

React Foundations: Installing Next.js | Next.js

nextjs.org · 899 words · saved by 1 readers

When you use Next.js in your project, you do not need to load the react and react-dom scripts from unpkg.com anymore. Instead, you can install these packages locally using npm or your preferred package manager. Note: To use Next.js, you will need to have Node.js version 18.17.0 or above installed on your machine (see minimum version requirement), you can download it here . To do so, create a new file in the same directory as your index.html file, called package.json with an empty object {}. In your terminal , run the following command in the root of your project: Once the installation is complete, you should be able to see your project dependencies listed inside your package.json file: Don't worry if you're on later versions than the ones shown above, as long as you have the next, react, and react-dom packages installed, you're good to go. You will also notice a new file called package-lock.json file that contains detailed information about the exact versions of each package. Jumping

9 Chapter 9 Installing Next.js When you use Next.js in your project, you do not need to load react and react-dom from a CDN with an import map anymore. Instead, you can install these packages locally using npm or your preferred package manager. Note : To use Next.js, you will need to have Node.js version 20.9 or above installed on your machine ( see minimum version requirement ), you can download it here . To do so, create a new file in the same directory as your index.html file, called package.json with an empty object {} . package.json {} In your terminal , run the following command in the r

Explore this link on the map →

related reading