简体   繁体   English

我是否需要Live Server上的“node_modules”文件夹

[英]Do I Need “node_modules” Folder on Live Server

这可能是一个愚蠢的问题,但我已经在我的计算机上安装了节点并且一直在运行创建我的sass的任务,这意味着我的项目文件夹中有一个node_modules文件夹,我想知道是否需要将node_modules文件夹上传到我的live服务器与否?

如果要在服务器上运行node.js项目,则应确保服务器已安装node.js,并且可以使用“npm install”来安装package.json的模块。

Tipically you must: 你必须:

  • To have installed Node.js in the server (and npm). 在服务器(和npm)中安装了Node.js.
  • You generate packaje.json in local. 你在本地生成packaje.json。 npm init . npm init You execute this in a folder containing node_modules. 您在包含node_modules的文件夹中执行此操作。
  • When package.json is generated. 生成package.json时。 You upload it to the server. 您将其上载到服务器。
  • When package.json is in the server, specifically in your project folder, you install all dependencies with npm install 当package.json在服务器中时,特别是在项目文件夹中,使用npm install安装所有依赖项

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

相关问题 如果我使用的是webpack,我是否需要实时主机服务器上的node_modules文件夹? - Do I need node_modules folder on live host server if I'm using webpack? 运行“gcloud builds submit./project-folder”时是否需要将node_modules添加到.gcloudignore? - Do I need to add node_modules to .gcloudignore when running “gcloud builds submit ./project-folder”? 将CI用于Bitbucket存储库-我是否需要在根文件夹中包含node_modules? - Using CI for Bitbucket repository - do I need to have node_modules inside my root folder? 如何快速删除 node_modules 文件夹? - How do I delete node_modules folder quickly? 服务器不在寻找node_modules文件夹 - Server is not looking for node_modules folder Next.js 生产版本是否需要服务器中的 node_modules 文件夹? - Does Next js production build need node_modules folder in the server? 我是否必须将我创建并想要导入的任何脚本/模块放置在 node_modules 文件夹中? - Do I have to place any scripts/modules I create and want to import within the node_modules folder? 每个父目录是否都需要有自己的node_modules文件夹? - Do each parent directories need to have their own node_modules folder? 我想在nodejs的服务器端文件夹之外创建node_modules文件夹 - i want to create node_modules folder outside my server side folder in nodejs 另一个文件夹中的 Node_modules - Node_modules in another folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM