Install dependencies: npm install Build JSON Editor: npm run build This will generate the files./jsoneditor.js,./jsoneditor.css, and minified versions in the dist of the project. To automatically build when a source file has changed: npm run watch. Npm-build Build a package Synopsis npm build []: A folder containing a package.json file in its root. This is the plumbing command called by npm link and npm install.

Active18 days ago

Trying to install modules from github results in:

ENOENT error on package.json.

Easily reproduced using express:

npm install https://github.com/visionmedia/express throws error.

npm install express works.

Why can't I install from github?

Here is the console output:

mikemaccana
47.5k51 gold badges247 silver badges320 bronze badges
guy mograbiguy mograbi
12.7k8 gold badges60 silver badges103 bronze badges

15 Answers

Because https://github.com/visionmedia/express is the URL of a web page and not an npm module. Use this flavor:

or this flavor if you need SSH:

Rory O'Kane
19.8k8 gold badges68 silver badges110 bronze badges
Peter LyonsPeter Lyons
116k22 gold badges235 silver badges248 bronze badges

You can also do npm install visionmedia/express to install from Github

or

There is also support for installing directly from a Gist, Bitbucket, Gitlab, and a number of other specialized formats. Look at the npm installdocumentation for them all.

Npm install github branchjasonszhao
1,2894 gold badges24 silver badges43 bronze badges
user2487135user2487135
6,1291 gold badge9 silver badges6 bronze badges
Pang
7,20716 gold badges68 silver badges108 bronze badges
Amitesh

Npm Install Build From Source Rpm

Amitesh

Npm Install Build From Source

1,7071 gold badge13 silver badges12 bronze badges

There's also npm install https://github.com/{USER}/{REPO}/tarball/{BRANCH} to use a different branch.

zakelfassizakelfassi
2,4601 gold badge17 silver badges19 bronze badges

Update September 2016

Installing from vanilla https github URLs now works:

EDIT: there are a couple of users commenting that you can't do this for all modules because you are reading from a source control system, which may well contain invalid/uncompiled/buggy code. So to be clear (although it should go without saying): given that the code in the repo is in an npm-usable state, you can now quite happily install directly from github

Npm install build toolsmikemaccana
47.5k51 gold badges247 silver badges320 bronze badges
FergieFergie
2,4863 gold badges26 silver badges32 bronze badges

The current top answer by Peter Lyons is not relevant with recent NPM versions. For example, using the same command that was criticized in this answer is now fine.

If you have continued problems it might be a problem with whatever package you were using.

Colin DColin D

The methods are covered pretty well now in npm's install documentation as well as the numerous other answers here.

However, something notable that has changed recently is npm adding the prepare script to replace the prepublish script. This fixes a longstanding problem where modules installed via git did not run the prepublish script and thus did not complete the build steps that occur when a module is published to the npm registry. See https://github.com/npm/npm/issues/3055.

Of course, the module authors will need to update their package.json to use the new prepare directive for this to start working.

nextgentechnextgentech
2,8251 gold badge20 silver badges18 bronze badges

UPDATE now you can do: npm install git://github.com/foo/bar.git
or in package.json:

Sagiv OfekSagiv Ofek
15k5 gold badges48 silver badges50 bronze badges

The general form of the syntax is

which means for your case it will be

From npmjs docs:

npm install :

Installs the package from the hosted git provider, cloning it with git. For a full git remote url, only that URL will be attempted.

| #semver:] is one of git, git+ssh, git+http, git+https, or git+file.

If # is provided, it will be used to clone exactly that commit. If the commit-ish has the format #semver:, can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither # or

If the repository makes use of submodules, those submodules will be cloned as well.

If the package being installed contains a prepare script, its dependencies and devDependencies will be installed, and the prepare script will be run, before the package is packaged and installed.

The following git environment variables are recognized by npm and will be added to the environment when running git:

  • GIT_ASKPASS
  • GIT_EXEC_PATH
  • GIT_PROXY_COMMAND
  • GIT_SSH
  • GIT_SSH_COMMAND
  • GIT_SSL_CAINFO GIT_SSL_NO_VERIFY

See the git man page for details.

Examples:

ishandutta2007ishandutta2007
6,0817 gold badges52 silver badges70 bronze badges

Install it directly:

Alternatively, you can add 'express': 'github:visionmedia/express' to the 'dependencies' section of package.json file, then run:

Tyler LongTyler Long
11.8k6 gold badges72 silver badges65 bronze badges
Alex CoryAlex Cory
3,4415 gold badges31 silver badges42 bronze badges

You can directly install an github repo by npm install command, like this:npm install https://github.com/futurechallenger/npm_git_install.git --save

NOTE: In the repo which will be installed by npm command:

  1. maybe you have to have a dist folder in you repo, according to @Dan Dascalescu's comment.
  2. You definitely have to have a package.json in you repo! which I forget add.
Bruce LeeBruce Lee
Khurshid AnsariKhurshid Ansari

I tried npm install git+https://github.com/visionmedia/express but that took way too long and I wasn't sure that would work.

What did work for me was - yarn add git+https://github.com/visionmedia/express.

ZephyrZephyr
Rahil LakhaniRahil Lakhani

Not the answer you're looking for? Browse other questions tagged githubnpmnpm-installnode-modules or ask your own question.

Users | From Source | Contributors and Development | Maintainers

zeromq: Your ready to use, prebuilt ØMQbindings for Node.js.

ØMQ provides handy functionality when working with sockets. Yet,installing dependencies on your operating system or building ØMQ fromsource can lead to developer frustration.

zeromq simplifies creating communications for a Node.jsapplication by providing well-tested, ready to use ØMQ bindings.zeromq supports all major operating systems, including:

  • OS X/Darwin (x64)
  • Linux (x64, ARMv7 and ARMv8)
  • Windows (x64 and x86)

Use zeromq and take advantage of the elegant simplicity of binaries.

Installation - Users

We rely on prebuild.

Install zeromq with the following:

windows users:do not forget to set msvs_version according to your visual studio version 2013,2015,2017npm config set msvs_version 2015Now, prepare to be amazed by the wonders of binaries.

To use your system's libzmq (if it has been installed and development headersare available):

Rebuilding for Electron

If you want to use zeromq inside your Electron applicationit needs to be rebuild against Electron headers. We ship prebuilt binaries for Electron so you won't need to build zeromq from source.

You can rebuild zeromq manually by running:

Where target is your desired Electron version. This will download the correct binary for usage in Electron.

For packaging your Electron application we recommend using electron-builder which handles rebuilding automatically. Enable the npmSkipBuildFromSource option to make use of the prebuilt binaries. For a real world example take a look at nteract.

Installation - From Source

If you are working on a Linux 32-bit system or want to install a development version, you have to build zeromq from source.

Prerequisites

Linux

  • python (v2.7 recommended, v3.x.x is not supported)
  • make
  • A proper C/C++ compiler toolchain, like GCC

Use your distribution's package manager to install.

macOS

  • python (v2.7 recommended, v3.x.x is not supported): already installed on Mac OS X
  • Xcode Command Line Tools: Can be installed with xcode-select --install

Windows

  • Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator).

  • Option 2: Install dependencies and configuration manually

    1. Visual C++ Build Environment:
    • Option 1: Install Visual C++ Build Tools using the Default Install option.
    • Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup.

    💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1

    1. Install Python 2.7 or Miniconda 2.7 (v3.x.x is not supported), and run npm config set python python2.7
    2. Launch cmd, and set msvs_version according to your visual studio version 2013,2015,2017npm config set msvs_version 2015

Installation

Now you can install zeromq with the following:

Installation - Contributors and Development

To set up zeromq for development, fork this repository andclone your fork to your system.

Make sure you have the required dependencies for building zeromq from source installed.

Install a development version of zeromq with the following:

Testing

Run the test suite using:

Running an example application

Several example applications are found in the examples directory. Usenode to run an example. To run the 'subber' application, enter thefollowing:

Examples using zeromq

Push/Pull

This example demonstrates how a producer pushes information onto asocket and how a worker pulls information from the socket.

producer.js

worker.js

Pub/Sub

This example demonstrates using zeromq in a classic Pub/Sub,Publisher/Subscriber, application.

Publisher: pubber.js

Subscriber: subber.js

For maintainers: Creating a release

When making a release, do the following:

Then, wait for the prebuilds to get uploaded for each OS. After theprebuilds are uploaded, run the following to publish the release:

Background

This codebase largely came from the npm module zmq and was, at one point, named nteract/zmq-prebuilt. It started as a community run fork of zmq that fixed up the build process and automated prebuilt binaries. In the process of setting up a way to do statically compiled binaries of zeromq for node, zmq-static was created. Eventually zmq-prebuilt was able to do the job of zmq-static and it was deprecated. Once zmq-prebuilt was shipping for a while, allowed building from source, and suggesting people use it for electron + node.js, the repository moved to the zeromq org and it became official.