简体   繁体   English

为什么“npm install”要求系统预装Node.js?

[英]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.我最近启动了 Tailwind CSS,我必须将 Tailwind 安装到我的系统中,不知道我的系统必须包含 Node.js 预装在我的系统中我继续粘贴npm install -D tailwindcss postcss autoprefixer在终端中但它抛出这么多错误。 After some research, I found about Node.js. Though my problem is solved I want to know why it happened.经过一番研究,我发现了大约 Node.js。虽然我的问题已经解决,但我想知道为什么会这样。

The reason it needs nodejs is as simple as, you need to have a nodejs to have/use the npm. Nothing more than that.它需要 nodejs 的原因很简单,你需要有一个 nodejs 才能拥有/使用 npm。仅此而已。

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 .深入了解您在这里所做的事情:通过运行npm install tailwind ,您正在安装一个名为npm tailwind package 管理工具。 Nodejs is the javascript environment that gonna execute it later when you use it Nodejs是javascript环境,以后用的时候会执行

Think of the the relationshipi between pip and python .想想pippython之间的关系。 When you try to install a python package, you use a python package manager called pip .当您尝试安装 python package 时,您使用了一个名为pip的 python package 管理器。 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.你在这里做的是,你需要 tailwind css 模块,现在你需要节点 package 管理器 (NPM) 来下载它并使用 nodejs。

Some furthur reading:一些延伸阅读:

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

Where your tailwind package come from: https://docs.npmjs.com/about-npm你的 tailwind package 来自哪里: https://docs.npmjs.com/about-npm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM