S
S
Senseich2018-03-19 01:19:21
css
Senseich, 2018-03-19 01:19:21

Do I need a node_modules folder in the project directory?

I must say right away that Gulp decided to try it for the first time today. And I'd like to know if that's the case.
I installed it according to the instructions on Geekbrains:
npm install -g gulp-cli
npm install gulp --save
- However, I didn’t quite understand why the command is repeated 2 times: npm install gulp ?
- And the second moment, the node_modules folder appeared in the site folder, as much as 9 mb. Is that how it should be? If so, how then to copy the finished site, without this directory and the files gulpfile.js, package.json. Or just remove it all.
Share skillful typesetters)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2018-03-19
@Senseich

The node-modules folder is needed for development (in other words, these are the various libraries that you can use in the project). Gulp is a task manager that, through various tasks, will eventually build your project. Most often, the so-called preprocessors (Pug, Sass, Less ...) are used in the front end and the sources are stored in a separate folder (for example, src or source), using Gulp, these files are assembled using the node_modules libraries into a finished project (html, css, js ) which is deployed to the hosting.
And to be honest, it's too early to use Gulp without at least basic knowledge and understanding of NodeJS.

V
Vladimir, 2018-03-19
@Casufi

GGalp does not work without a config, so in the config you will write the folder in which you build the project before deploying it to the server. Nobody deploys the project from the root and the node_modules folder is needed.
https://learn.javascript.ru/screencast/gulp

D
Dima Polos, 2018-03-19
@dimovich85

Gulp-cli is needed so that you can access gulp directly in the console, otherwise you would have to write something like npm run ..., node gulpfile.js ... Now you can write gulp sass (for example), and that's it. The node_modules folder should appear, these are the modules that are needed for the gallp, in particular, to work, but it is NOT needed on the server AT ALL! And do not try to shove it into git or send it to programmers)) You need to send the project with package.json, and the rest of the folders in which you work, ala src, and plus all sorts of .babelrc, .gitignore, readme.md and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question