I want to mention two things for beginners out there like me.
Use npm init -y to skip all the questions in npm init
Some NPM package documentations don't explicitly mention to use --save flag in their npm install quickstart or install guide.
This had me confused at first. I wondered why won't they add a --save flag because if you upload your application it would break because of missing dependencies. The dev said it's up to you if you want to use their package as a dependency or a dev dependency. But obviously, the package they are offering should be saved as a core dependency (and so he modified the docs).
TLDR: Some documentation don't mention the --save or --save-dev flag in their installation. Don't be afraid to add either flags!
Oh.. that's a neat addition. Last time I checked, it didn't save in my package.json. Maybe I have a lower version of npm. Thanks for this! Really useful!
I want to mention two things for beginners out there like me.
npm init -yto skip all the questions in npm init--saveflag in theirnpm installquickstart or install guide. This had me confused at first. I wondered why won't they add a--saveflag because if you upload your application it would break because of missing dependencies. The dev said it's up to you if you want to use their package as a dependency or a dev dependency. But obviously, the package they are offering should be saved as a core dependency (and so he modified the docs).TLDR: Some documentation don't mention the
--saveor--save-devflag in their installation. Don't be afraid to add either flags!Also npm version 5 saves the package in package.json by default, If you don’t want to save, you can override the default saving with --no-save
I think like package-lock.json, this was another nice feature of yarn they implemented.
Oh.. that's a neat addition. Last time I checked, it didn't save in my package.json. Maybe I have a lower version of npm. Thanks for this! Really useful!
Maybe you were using an npm version lower than 5