Saturday, 27 May 2017

How to call a global npm command in Meteor?

Background

Meteor is shipped with a packaged npm. Calling any npm related commands requires the following pattern:

meteor npm [command]

I installed a global npm package (npm-install-missing):

meteor npm install -g npm-install-missing

Problem

It is intended to be called as a toplevel command:

Usage

Within your project directory:

npm-install-missing The script will check the current project directory for missing dependencies and install them automatically.

So I tried inside my project dir the some possible variations of calling it:

1. meteor npm-install-missing

Obviously as calling npm via meteor using the meteor command in before. Turned out to be wrong:

> meteor npm-install-missing

> 'npm-install-missing' is not a Meteor command. See 'meteor --help'.

2. npm-install-missing (without meteor command)

Ok, so maybe it is top-level installed and I can call it like so. Turned out to be wrong, too.

> npm-install-missing
> npm-install-missing is not recognized as an internal or external command

3. meteor npm run npm-install-missing

Obviously wrong, because I have no script in my package.json but I gave it a try anyway. Turned out to be wrong:

> meteor npm run npm-install-missing
> npm ERR! missing script: npm-install-missing

Question

How can I call this package without additionally installing nodejs and npm?



via Jankapunkt

No comments:

Post a Comment