In my package.json file I have declared dependencies which one from public registry and second from private registry (Artifactory in this case).
"dependencies": {
"vue": "^2.4.4", //public registry
"ce-ui": "http://myartifactory.com/artifactory/npm-local/ce-ui/-/ce-ui-0.0.2.tgz"
}
I'm looking for way to declare dependencies using caret or tidle e.g.
"dependencies": {
"vue": "^2.4.4",
"ce-ui": "^0.0.2"
}
Thank you in advance.
Summary. For npm install specific version, use npm install [package-name]@[version-number]. Use npm view [package-name] version to know the specific latest version of a package available on the npm registry. Use npm list [package-name] to know the specific latest version of an installed package.
To specify the packages your project depends on, you must list them as "dependencies" or "devDependencies" in your package's package. json file. When you (or another user) run npm install , npm will download dependencies and devDependencies that are listed in package.
To have dependencies from different registries referred in same package.json, npm recommends to use scope
Scoped packages will look like
"dependencies": {
"@myorg/mypackage": "^1.3.0"
}
You can associate a scope with a registry using npm config:
npm config set @myorg:registry http://reg.example.com
Once a scope is associated with a registry, any npm install for a package with that scope will request packages from that registry instead of default registry https://registry.npmjs.org
Refer: https://docs.npmjs.com/cli/v6/using-npm/scope
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With