Tejaswini G
Tejaswini G

Reputation: 11

Why does "npm install" require Node.js preinstalled in the system?

I've recently started Tailwind CSS where I've to install Tailwind into my system, not knowing the fact that my system has to contain Node.js preinstalled in my system I proceeded to paste npm install -D tailwindcss postcss autoprefixer in the terminal but it threw so many errors. After some research, I found about Node.js. Though my problem is solved I want to know why it happened.

Upvotes: 0

Views: 753

Answers (1)

nick
nick

Reputation: 489

The reason it needs nodejs is as simple as, you need to have a nodejs to have/use the npm. Nothing more than that.

Diving into what you are doing here: By running npm install tailwind, you are installing a node package called tailwind with a package management tool called npm. Nodejs is the javascript environment that gonna execute it later when you use it

Think of the the relationshipi between pip and python. When you try to install a python package, you use a python package manager called pip. What you are doing here is, you need tailwind css module, now you need node package manager (NPM) to have it download and work with nodejs.

Some furthur reading:

what is npm: https://www.w3schools.com/whatis/whatis_npm.asp

Where your tailwind package come from: https://docs.npmjs.com/about-npm

Upvotes: 2

Related Questions