Initialize the Backend Repo


#1

Link to chapter - https://serverless-stack.com/chapters/initialize-the-backend-repo.html


#2

Hi @jayair,

My question is regarding the size of the repo after running ‘npm install’ which created node_modules.

It seems to me the entire repo including the huge node_modules subdir is then pushed to the github.

bash-3.2$ npm install
...
bash-3.2$ cd ..
bash-3.2$ du -sh serverless-stack-2-api/
127M	serverless-stack-2-api/
bash-3.2$ 

I imagine a lot of what’s in node_modules is only needed during development.

Is it necessary to push 127 MB of node_modules to github?
Thanks very much.


#3

Oh yeah you shouldn’t commit the node_modules/ dir. It is generated every time you run npm install.


#4

A recommendation - after doing

$ git remote add origin REPO_URL

If we do

npm init (-y)

again, the change (repo field) will be reflected in package.json.

Could be a useful addition to the tutorial.


#5

Ah good point. I’ll look into adding it in.


#6

When I run npm install, I get the following message: found 128 vulnerabilities (54 low, 55 moderate, 19 high)
Is this the case for everyone else? Is there anything that can be done to remedy these vulnerabilities?


#7

I think you need to run npm audit fix for that.


#8

Wow, that fixed all of them. Thanks. (Unfortunately it created a few more, which don’t seem to be fixable with npm audit fix, but a few is certainly better than 128.)