npm install to just update dependency - npm

I guess this sounds silly but is there a way to do npm install my-module such that it only updates the dependencies section of package.json but doesn't actually go through the install process?

Related

How to manage a non-node module as dependency for Node Project thorugh NPM?

I was using bower in my project for dependency management. But now I wanted to move to node and npm. But the problem is few of my dependencies are not node modules like Smooth-Div-Scroll1 and swiftype-search-jquery2
How to manage all those dependencies in my node project. When I tried doing
"swiftype-search-jquery": "git#github.com:swiftype/swiftype-search-jquery.git",
"smooth-div-scroll": "git#github.com:tkahn/Smooth-Div-Scroll.git",
it is not able to download dependency and throw error
npm ERR! code ENOPACKAGEJSON npm ERR! package.json Non-registry package missing package.json: swiftype-search-jquery#git+ssh://git#github.com/swiftype/swiftype-search-jquery.git. npm ERR! package.json npm can't find a package.json file in your current directory.
These dependencies don't have package.json in their folder.
I don't think it's possible.
Here is a guide to migrate from bower to npm, it's pretty easy.
https://codecraft.tv/courses/angularjs-migration/step-2-typescript-and-webpack/converting-bower-to-npm/
Yup, It is not possible with NPM but at the same time, it is possible with Yarn without making any change. Instead of "npm install" we have to use "yarn install" .
Add dependencies with git url which is not present with NPM .

How to add npm module without changing old dependencies in package-lock.json?

I use npm ci to install npm modules and it install same package versions as in package-lock.json
And now I need to add npm module for starting write unit tests, I use this command: npm i jest
I expect that it should add only jest dependencies, but npm update all out-of-date dependencies of 3-5 level dependencies in package-lock.json
I would like to do something like this npm ci --save-dev jest
How to install npm package without changing old dependencies in package-lock.json?
UPD For example, please clone this repo, after that use npm ci and npm i empty-module, if you look at git diff you'll see a lot of changes of package-lock.json file

npm does not install new package after modifying package.json

I have a web application with some packages defined in package.json after I run npm install all dependencies are resolved. However when I add some packages after that to package.json and run npm install again nothing happens. I did the work around by typing npm install --save lodash and it downloaded the dependency and updated packages.json. It works, but let's imagine the scenario when I want to add 10 or more packages. Then it would be easier for me to just add them to package.json and run npm install but this does not work :/. So what would be the solution for the problem off adding more packages after initial npm install?
Node version: v8.1.3
npm version: 5.03
Operating System: Windows 10 Pro

how to update package.json after npm installl in a package

I'm writing a npm package, I'd like the package to update package.json file in the installed folder, say:
npm install mypackage
this installs mypackage, and also read the package.json in the folder where npm install is run, and write some entries, possible?
Thanks,
npm i -g npm-check-updates
npm-check-updates -u
npm install
or for a specific package, you may change dependency version and then
npm update --save

How to "npm install" only when the package being installed is not current

How can I make so npm install package will only install the package if there is a newer package in the npm registry.
I mean that it won't even check the dependencies but only the main package I want.
npm update package should do this.