
Install Node js and Npm latest Version on Raspberry Pi 4?
Hey Everyone, my name is Rajdeep Singh. I’m a Front-end developer in India. you are interested to install npm and node.js latest version in your …
Read MoreNpm is the node package manager for JavaScript. The npm help manage code and share code with others developers. We start the Npm series for beginners to pro-level developers.
Our first command is the npm init command. Next, create a package.json file in the folder.
npm init <Options>
The npm init command help to create a node.js setup for the developer. In step-up, the init command creates a package.json file and add a basic configuration related to the project in the package.json file.
npm init -y
Npm init -y flag is most comman flag in npm. lots of developers use it daily in the day. -y flag help to create an essential step up with the package.json file.
Inside the package.json file, eight properties by default define it.
{
"name": "npmtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Most of the time, many people use a create an alias. The create aliases are the most common alias for reactjs developers. So if you are a reactjs developer, most of the time, you use it to create an alias.
npx create-react-app my-app
or
npx create-next-app@latest
With the npm init command, you can install the direct package from npmjs.org.
For example, purpose creates a nextjs app with npm init. By default, npm init create an alias.
npm init next-app
In creating an alias, you do not need to mention create prefixes at the front of the command. Init command by default use creates prefix. It runs the create-next-app@latest version.
Your init next-app command output looks like.
npm init create-next-app
npm init -w command is similar to npm init -w. but npm init -w command help to set up your workspace with the project.
{
"name": "npmtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"workspaces": [
"true"
]
}
npm init -w command add workspaces option in package.json file—the workspace help for IDE.
https://docs.npmjs.com/cli/v8/commands/npm-init
npm init is the most used command in npm. Many developers use the init command to set up new projects with the default configuration.
Many YouTubers and writers use the npm init -y flag or the option to set up npm new project. Because npm init -y comes with straightforward syntax, the second reason is that it is straightforward to use compared to npm init -w.
Hey Everyone, my name is Rajdeep Singh. I’m a Front-end developer in India. you are interested to install npm and node.js latest version in your …
Read MoreFlatpak is a Linux application distribution manager similar to the snap store. Flatpak is faster than the snap pack. If you have a snap store user, …
Read More