1

Let's say I have an own server and on the server I have Node.js modules. How can I install these Node modules? Is there global configuration file where I can add my own server? Or can I define my server in an user configuration file in my current Node project? Or is there a parameter like -server which I can add to npm install myownmodule? I want to keep my module private.

1 Answer 1

2

You can point to a tarball url.

Running npm pack will create the tarball, which you can put on your server and then install it via:

npm install <tarball url>

Running your own private npm repo with verdaccio is pretty straightforward too if you'd prefer that route. You can set up .npmrc to publish scoped packages to your own repo instead of npmjs, etc.

Associating a scope with a registry looks like this:

; Set a new registry for a scoped package
@myscope:registry=https://mycustomregistry.example.org

Just replace https://mycustomregistry.example.org with wherever verdaccio is running.

Docs: https://docs.npmjs.com/misc/config#scope

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.