Unable to resolve dependency for npm private module in node js

378 Views Asked by At

I have created a private module in node and published it to the nexus repository. The private module is using 'cryptr' module for encryption. When I install the private module to my application and try to access methods inside it, getting an exception as module 'cryptr' is not found. The cryptr module is not directly referring to my application. It is used in the private module that is installed in the application.

How to avoid installing dependencies by referring to the private module again in the application which is using the private module.

package.json for the private module

{
  "name": "@app/private1",
  "version": "0.0.1",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "cryptr": "6.0.3"
  },
  "publishConfig": {
    "registry": "https://nexus.test.com/repository/repo/"
  }
}
0

There are 0 best solutions below