S
S
sanphir2017-03-21 12:12:27
Node.js
sanphir, 2017-03-21 12:12:27

How to properly store a node.js project in a repository?

We have a node.js project in Visual studio with protractor tests. What is the correct way to store node_modules folder in svn repository and what is the correct way to resolve dependencies between modules? And in general, is it necessary to store it in svn or that everyone would download the modules themselves, or in general they should be global.
the following packages are installed locally in the project
"devDependencies": {
"@types/node": "^7.0.8",
"imap": "^0.8.18",
"jasmine-reporters": "^2.2.0",
" jasmine2-protractor-utils": "^1.2.7",
"protractor": "^5.1.1",
"typescript": "^2.2.1",
"webdriver-manager": "^12.0.4"
},
Now the folder is stored in a turnip, but on some machines it does not see local dev modules. In the studio they are displayed, but from the command line there is zero reaction.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Anton, 2017-03-21
@Fragster

I have /node_modules/ in .gitignore, and I wish you the same. Surely svn also has such settings

G
g00dv1n, 2017-03-21
@g00dv1n

All dependencies are described in package.json.
You don't need to store node_modules in svn, that's what package.json is for.
In theory, after npm i , everything should be fine locally. If there are modules that need to be installed globally (I see that protractor is one of them), then take them out like this:

"scripts": {
  "preinstall": "npm i -g protractor"
}

A
Anton_KA, 2017-10-12
@Anton_KA

https://habrahabr.ru/post/185200/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question