Disable dtrace from NPM Install

1,073 views
Skip to first unread message

Alan Gutierrez

unread,
Jun 28, 2013, 12:39:39 PM6/28/13
to bunyan-...@googlegroups.com
When I install using `npm install bunyan`, I end up doing a slow rebuild
of something or other. I'm not looking to closely, but I assume it is
dtrace related. It there an easy way to disable this dependency from via
my `package.json`? Or how can I exclude it?

--
Alan Gutierrez ~ @bigeasy

Trent Mick

unread,
Jun 28, 2013, 1:44:51 PM6/28/13
to Alan Gutierrez, bunyan-...@googlegroups.com
Alan,

Yah, the "slow rebuild" is the node-dtrace-provider optional dep. It has a shim that is meant to make it just stub out no-op behaviour for platforms that don't support dtrace (e.g. the linux on RPi).  The 'dtrace-provider' dep used to be in "dependencies" for node-bunyan, i.e. not optional, because I wanted to avoid a build failure there NOT being noticed on dtrace-y platforms. However it was moved to be an "optionalDependency" because the requirement to have a C++ compiler at all was burdensome (e.g. on Windows).

I don't know of a way to "npm install FOO" and NOT attempt to install the optional dependencies... without removing the "dtrace-provider" entry from bunyan's package.json ahead of time. Ideally I'd want a way to tell npm that the "dtrace-provider" dep is only for a specified set of platforms (e.g. smartos, illumos, mac).

Is the slow rebuild *breaking* you? Or more just a real burden on your build/install/setup process?


Trent

--
Trent Mick

Alan Gutierrez

unread,
Jun 29, 2013, 7:18:09 AM6/29/13
to Trent Mick, bunyan-...@googlegroups.com
On Fri, Jun 28, 2013 at 10:44:51AM -0700, Trent Mick wrote:

> Yah, the "slow rebuild" is the node-dtrace-provider optional dep. It has a
> shim that is meant to make it just stub out no-op behaviour for platforms
> that don't support dtrace (e.g. the linux on RPi). The 'dtrace-provider'
> dep used to be in "dependencies" for node-bunyan, i.e. not optional,
> because I wanted to avoid a build failure there NOT being noticed on
> dtrace-y platforms. However it was moved to be an "optionalDependency"
> because the requirement to have a C++ compiler at all was burdensome (e.g.
> on Windows).
>
> I don't know of a way to "npm install FOO" and NOT attempt to install the
> optional dependencies... without removing the "dtrace-provider" entry from
> bunyan's package.json ahead of time. Ideally I'd want a way to tell npm
> that the "dtrace-provider" dep is only for a specified set of platforms
> (e.g. smartos, illumos, mac).
>
> Is the slow rebuild *breaking* you? Or more just a real burden on your
> build/install/setup process?

From our exchanges on Twitter:

`npm install --no-optional` works great, thank you.

--
Alan Gutierrez ~ @bigeasy
~
Reply all
Reply to author
Forward
0 new messages