How would you execute npm install with a specific version from the nexus repo - npm

How to execute npm install with a specific version from the nexus repo?
My artifacts are stored in Nexus. what I need to do is execute npm install <nexus version>. However when I do this it still uses my latest package.json that I committed. I want to use all artifacts including package.json from the version in my nexus repo.

Using npm via NXRM behaves the same as using npm without NXRM as far as installs go. You can use npm install package#version.
So for example, npm install pluto#0.4.0.
See npm install doc for more details.

Related

What is the difference between the following npm install statements?

npm install #uiw/react-monacoeditor --save
VS
npm i #uiw/react-monacoeditor
What is the difference between following npm install statements when to use --save flag?
Currently they will not differ at all. Since NPM 5 packages are automatically saved into package.json dependencies when installed.
npm I is the short version of npm install so that part of the command does not differ at all either.
You can read more about the install command here: https://docs.npmjs.com/cli/v8/commands/npm-install
And there is does say “ npm install saves any specified packages into dependencies by default.”

Errors when doing npm install

I've already installed Node.js in my machine. When I try npm install, the installation does not properly work for me. I get the following on my console:
Installed node version 14.15.1
Installed npm version 6.14.8
Installed angular cli version 11.2.3
And then some errors pop up. Here's a screenshot of my console:
Any of the following methods might be useful for you:
Method 1: Clean cache & then perform an installation
npm cache clean --force
npm install
Method 2: Exclude package-lock.json file and perform an installation
npm install --no-package-lock
Method 3: Manually delete node_modules and package-lock.json file and then perform an installation
npm install

npm install result in an incomplete module, but yarn install is successful, why they behave differently?

I tried npm install and npm install --no-optional for my forked repository, and it was not installed completely: git+https://github.com/marsonmao/react-sketch#v0.4.104 (link).
After using npm install, only part of the repository was installed: there are only /node_modules and .eslintrc, karma.config.js, README.md...etc in MyProject/node_modules/react-sketch, but no /lib and /src...etc.
Then I tried yarn install and it was successful, every file in the repository was installed.
So why npm failed however yarn succeeded?
npm version: 5.5.1, yarn version: 1.3.2

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

npm install express will cause many package to be installed

I am reading the Installing npm packages locally guide and looking for information about why when I use npm install express to install that package, nearly 40 other packages installed in the node_modules sub-directory.
Also if NPM supports the method as described above, how do we use npm publish to publish a bundle of packages in one command for download in NPM?