Do I Need "node_modules" Folder on Live Server

时间:2015-11-12 11:02:58

标签: node.js server

This may be a silly question but I have installed node on my computer and have been running tasks for creating my sass which means I have a node_modules folder within my project folder and I'm wondering if I need to upload the node_modules folder to my live server or not?

2 个答案:

答案 0 :(得分:0)

You should make sure that your server had installed node.js if you want to run node.js project on your server and you can use 'npm install' to install the modulars of the package.json.

答案 1 :(得分:0)

Tipically you must:

  • To have installed Node.js in the server (and npm).
  • You generate packaje.json in local. npm init. You execute this in a folder containing node_modules.
  • When package.json is generated. 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