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.
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:
mikemaccanaBecause 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'KaneYou 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 install
documentation for them all.
There's also npm install https://github.com/{USER}/{REPO}/tarball/{BRANCH}
to use a different branch.
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
mikemaccanaThe 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.
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.
UPDATE now you can do: npm install git://github.com/foo/bar.git
or in package.json
:
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:
See the git man page for details.
Examples:
ishandutta2007ishandutta2007Install it directly:
Alternatively, you can add 'express': 'github:visionmedia/express'
to the 'dependencies'
section of package.json
file, then run:
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:
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
.
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:
Use zeromq and take advantage of the elegant simplicity of binaries.
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 2015
Now, prepare to be amazed by the wonders of binaries.
To use your system's libzmq (if it has been installed and development headersare available):
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.
If you are working on a Linux 32-bit system or want to install a development version, you have to build zeromq
from source.
Linux
python
(v2.7
recommended, v3.x.x
is not supported)make
Use your distribution's package manager to install.
macOS
python
(v2.7
recommended, v3.x.x
is not supported): already installed on Mac OS XXcode 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
💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1
v3.x.x
is not supported), and run npm config set python python2.7
npm config set msvs_version 2015
Now you can install zeromq
with the following:
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:
Run the test suite using:
Several example applications are found in the examples
directory. Usenode
to run an example. To run the 'subber' application, enter thefollowing:
This example demonstrates how a producer pushes information onto asocket and how a worker pulls information from the socket.
producer.js
worker.js
This example demonstrates using zeromq
in a classic Pub/Sub,Publisher/Subscriber, application.
Publisher: pubber.js
Subscriber: subber.js
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:
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.