Best practice on `npm login` during provision

27 views
Skip to first unread message

Giovanni Gaglione

unread,
Oct 20, 2015, 4:31:48 AM10/20/15
to Vagrant
I need to install npm private packages during provision.

But they require `npm login` execution before installing private packages, otherwise npm will not find any priate package.

Because provision is not interactive, even if I run `npm login` during provision then I can't specify username and password.

So how to manage it?

I would avoid to put in the Vagrant machine filesystem files coming from the host - e.g. containing credentials or tokens - because I assume the host has no npm installed.

Alvaro Miranda Aguilera

unread,
Oct 22, 2015, 6:00:54 AM10/22/15
to vagra...@googlegroups.com
Hello

Please have a look at packer.io (also hashicorp)

that will allow you create the box, and all the information can be in
a template file

And you can use that to create vagrant boxes.

Alvaro

Giovanni Gaglione

unread,
Oct 23, 2015, 6:39:28 AM10/23/15
to vagra...@googlegroups.com
I see.

But I would like to avoid to learn a new tool and new documentation.

For the moment I fixed it manually logging in npm, and then exporting the machine as a new box.

This should work I think.


Reply all
Reply to author
Forward
0 new messages