nixos / npm2nix Goto Github PK
View Code? Open in Web Editor NEWGenerate nix expressions to build npm packages
License: MIT License
Generate nix expressions to build npm packages
License: MIT License
I have a project which uses several private modules which are not on npms but just git repos. So npm2nix will fail with something like :
building path(s) ‘/nix/store/z0dnfrb0riii8mgzg9k7mdfh3i7gpgbq-healthcheck-middleware-e288c34’
exporting ssh://[email protected]/dragon/healthcheck-middleware.git (rev e288c349675d4a2fbfd9e0c194797bbaa7377406) into /nix/store/z0dnfrb0riii8mgzg9k7mdfh3i7gpgbq-healthcheck-middleware-e288c34
Initialized empty Git repository in /nix/store/z0dnfrb0riii8mgzg9k7mdfh3i7gpgbq-healthcheck-middleware-e288c34/.git/
error: cannot run ssh: No such file or directory
fatal: unable to fork
error: cannot run ssh: No such file or directory
fatal: unable to fork
Unable to checkout e288c349675d4a2fbfd9e0c194797bbaa7377406 from ssh://[email protected]/dragon/healthcheck-middleware.git.
builder for ‘/nix/store/jmrypk071qp14z0q9crbz3ij1s3x6h0c-healthcheck-middleware-e288c34.drv’ failed with exit code 1
building path(s) ‘/nix/store/hkw9rj95qd5sqws7nlw0bg80yin2r9z2-hoist-non-react-statics-1.0.2.tgz’
cannot build derivation ‘/nix/store/ilcpj8lsv4h9mjk5pdf2za9hg0jimq0q-nodejs-healthcheck-middleware-1.0.0.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/fy0hiahnlvqjfk0ynq5nbmqiwbgmzi9v-nodejs-infrastructure-0.7.2.drv’: 1 dependencies couldn't be built
killing process 12934
cannot build derivation ‘/nix/store/zzvrm0xxnizryhixq1aakssk7y7kda9f-nodejs-hc-react-stack-pages-0.0.0.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/zzvrm0xxnizryhixq1aakssk7y7kda9f-nodejs-hc-react-stack-pages-0.0.0.drv’ failed
Can this be supported at all ? And if not could you provide some info on a possible workaround for this scenario ?
A user's ~/.npmrc might have, for example, a different registry URL, which could end up generating the wrong package set. This behavior can be disabled manually with npm_config_userconfig=/dev/null npm2nix [...]
, but it'd be nicer not to need to remember.
Thus, it crashes.
https://github.com/NixOS/npm2nix/blob/master/src/npm2nix.coffee#L201
https://github.com/NixOS/npm2nix/blob/master/src/npm2nix.coffee#L238
Yay for dynamically typed languages
Using nixos-unstable and npm2nix 5.12.0, I cannot rebuild nix-packages-generated.nix:
npm2nix pkgs/top-level/node-packages.json pkgs/top-level/node-packages-generated.nix
Gives me the error:
Error during fetch: Error fetching git://github.com/NixOS/npm2nix.git#5.12.0 from git: git rev-parse's stdout ended before 64 characters were read
error: could not lock config file /tmp/npm2nix-git-checkout-kibana-authentication-proxy11634-1738-1u8vxp1/kibana-authentication-proxy/.git/modules/kibana/config: No such file or directory
fatal: Could not set 'remote.origin.fetch' to '+refs/heads/*:refs/remotes/origin/*'
fatal: clone of 'https://github.com/elasticsearch/kibana.git' into submodule path 'kibana' failed
This is the first time I'm using npm2nix
, so I might very well do something completely wrong.
When I try to add react-tools
I see the following:
remote: Total 5490 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5490/5490), 20.58 MiB | 662.00 KiB/s, done.
Resolving deltas: 100% (3303/3303), done.
Checking connectivity... done.
fatal: ambiguous argument 'harmony': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error during fetch: Error fetching https://github.com/ariya/esprima.git#harmony from git: git rev-parse exited with non-zero status code 128
The npm
itself installs the package without issues
Hi,
As part of NixOS/teams-collaboration#1, I am trying to clarify the status of the repositories under the NixOS organisation.
This repository seems to be unmaintained or obsolete, so it will be archived in a month.
If you think it warrants staying here or should be moved to another organization instead, please answer this issue.
In #21 there was a discussion about an alternative method of retrieving package information.
At the moment npm and node change quite often, as do their file structures. Relying on the structure of package.json is therefore often errorprone.
If we could reuse npm to do as much as possible, we could circumvent this problem. It might be somewhat less efficient compared to the current implementation, but since npm2nix is usually not run daily, this does not matter much.
I created this issue to focus on reusing npm and gather all the necessairy bits needed to get to an implementation of npm2nix.
npm install
creates node_modules with all dependencies of package.json installed.npm ls --json
shows a recursive list in JSON of all packages and their dependencies.github:
and probably others will be used as dependencies in the near future. We need to get npm to download these as git repos, so that we can hash them.github:
URLs.Currently npm2nix package.json package.nix
creates a default.nix that adds packages under devDependencies to deps. Everything listed in packages.json under devDependencies is ignored.
Hello !
I've been starting with Nix for few days now, and was particularly interested in using it to handle JS dependencies (I really like the philosophy behind it 😃).
IMHO, one of the major problem with npm is the existence of postinstall
... I've encountered several packages (like jpegtran-bin
or phantomjs
if I remember well, which are simply wrappers to download the appropriate binary).
I just made the test with the jpegtran-bin
package and the output concerning this package is :
by-spec."jpegtran-bin"."^3.0.0" =
self.by-version."jpegtran-bin"."3.0.6";
by-version."jpegtran-bin"."3.0.6" = self.buildNodePackage {
name = "jpegtran-bin-3.0.6";
version = "3.0.6";
bin = true;
src = fetchurl {
url = "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-3.0.6.tgz";
name = "jpegtran-bin-3.0.6.tgz";
sha1 = "d266af271a7603046984fd31c3c2503407b92323";
};
deps = {
"bin-build-2.2.0" = self.by-version."bin-build"."2.2.0";
"bin-wrapper-3.0.2" = self.by-version."bin-wrapper"."3.0.2";
"logalot-2.1.0" = self.by-version."logalot"."2.1.0";
};
optionalDependencies = {
};
peerDependencies = [];
os = [ ];
cpu = [ ];
};
It may be a naive question but do you think it would be feasible to support postinstall
option ?
Thats the result with node v0.12.0
{ self, fetchurl, fetchgit ? null, lib }:
{%
Hello,
I have trouble importing baucis npm module with npm2nix, it try to connect to an non available version of one dependency ([email protected], whom exist but not available anywhere), baucis is suppose to use baucis-json@^1.0.0-candidate.1.
below the failed result:
npm2nix node-packages.json node-packages.generated.nix
info trying registry request attempt 1 at 17:13:54
http GET https://registry.npmjs.org/baucis-error
info trying registry request attempt 1 at 17:13:54
http GET https://registry.npmjs.org/baucis
http 304 https://registry.npmjs.org/baucis-error
info trying registry request attempt 1 at 17:13:54
http GET https://registry.npmjs.org/deco
info trying registry request attempt 1 at 17:13:54
http GET https://registry.npmjs.org/mongoose
http 304 https://registry.npmjs.org/deco
http 304 https://registry.npmjs.org/mongoose
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/requireindex
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/ms
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/hooks
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/sliced
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/mongodb
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/muri
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/mpromise
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/regexp-clone
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/mpath
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/mquery
http 304 https://registry.npmjs.org/ms
http 304 https://registry.npmjs.org/baucis
http 304 https://registry.npmjs.org/hooks
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/semver
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/event-stream
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/baucis-json
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/express
http 304 https://registry.npmjs.org/sliced
http 304 https://registry.npmjs.org/muri
http 304 https://registry.npmjs.org/requireindex
http 304 https://registry.npmjs.org/mongodb
http 304 https://registry.npmjs.org/semver
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/bson
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/kerberos
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/readable-stream
http 304 https://registry.npmjs.org/mpromise
http 304 https://registry.npmjs.org/mpath
http 304 https://registry.npmjs.org/event-stream
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/through
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/duplexer
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/from
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/map-stream
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/pause-stream
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/split
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/stream-combiner
http 304 https://registry.npmjs.org/mquery
info trying registry request attempt 1 at 17:13:55
http GET https://registry.npmjs.org/debug
http 304 https://registry.npmjs.org/regexp-clone
http 304 https://registry.npmjs.org/baucis-json
http 304 https://registry.npmjs.org/readable-stream
http 304 https://registry.npmjs.org/through
http 304 https://registry.npmjs.org/duplexer
Error during fetch: Could not find version matching ~1.0.0-prerelease.3 for baucis-json in { '0.0.1':
{ name: 'baucis-json',
version: '0.0.1',
description: 'Streaming JSON parser and formatter for baucis.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '~0.16.15' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land' },
license: 'MIT',
dependencies: { 'event-stream': '^3.1.1' },
_id: '[email protected]',
dist:
{ shasum: '2077fa8ae48782cc0f251738cd999f97b86ff149',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-0.0.1.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'0.0.2':
{ name: 'baucis-json',
version: '0.0.2',
description: 'Streaming JSON parser and formatter for baucis.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '~0.16.15' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land' },
license: 'MIT',
dependencies: { 'event-stream': '^3.1.1' },
_id: '[email protected]',
dist:
{ shasum: 'a3f2460fcd94d070040c199b22d0ddf398ecc4e3',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-0.0.2.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'0.0.3':
{ name: 'baucis-json',
version: '0.0.3',
description: 'Streaming JSON parser and formatter for baucis.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '~0.16.15' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land' },
license: 'MIT',
dependencies: { 'event-stream': '^3.1.1' },
_id: '[email protected]',
dist:
{ shasum: 'a7e9af377617889db40319ebc1351228ba807017',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-0.0.3.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'0.0.4':
{ name: 'baucis-json',
version: '0.0.4',
description: 'Streaming JSON parser and formatter for baucis.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '>=0.16.15' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
_id: '[email protected]',
dist:
{ shasum: 'aceedb763f24560724fd396e31f880659522b8bc',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-0.0.4.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'0.1.0':
{ name: 'baucis-json',
version: '0.1.0',
description: 'Baucis uses this to parse and format streams of JSON.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '>=0.16.15' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land', email: '[email protected]' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
repository: { type: 'git', url: 'https://github.com/wprl/baucis-json.git' },
bugs:
{ url: 'https://github.com/wprl/baucis-json/issues/new',
email: '[email protected]' },
homepage: 'https://github.com/wprl/baucis-json',
_id: '[email protected]',
dist:
{ shasum: 'b6f32a9a98234fb5cdde5b78c30f702b12b86a52',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-0.1.0.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'0.1.1':
{ name: 'baucis-json',
version: '0.1.1',
description: 'Baucis uses this to parse and format streams of JSON.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '>=0.16.15' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land', email: '[email protected]' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
repository: { type: 'git', url: 'https://github.com/wprl/baucis-json.git' },
bugs:
{ url: 'https://github.com/wprl/baucis-json/issues/new',
email: '[email protected]' },
homepage: 'https://github.com/wprl/baucis-json',
_id: '[email protected]',
dist:
{ shasum: '7880a5c6ffc07f4a736d1b9977507822bf2795ac',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-0.1.1.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'1.0.0-prerelease.1':
{ name: 'baucis-json',
version: '1.0.0-prerelease.1',
description: 'Baucis uses this to parse and format streams of JSON.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '>=1.0.0-prerelease.6' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land', email: '[email protected]' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
repository: { type: 'git', url: 'https://github.com/wprl/baucis-json.git' },
bugs:
{ url: 'https://github.com/wprl/baucis-json/issues/new',
email: '[email protected]' },
homepage: 'https://github.com/wprl/baucis-json',
_id: '[email protected]',
dist:
{ shasum: '0c1fec315817f75f6277328b9ac813d660c1fa59',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-1.0.0-prerelease.1.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'1.0.0-prerelease.2':
{ name: 'baucis-json',
version: '1.0.0-prerelease.2',
description: 'Baucis uses this to parse and format streams of JSON.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '>0.20.0' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land', email: '[email protected]' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
repository: { type: 'git', url: 'https://github.com/wprl/baucis-json.git' },
bugs:
{ url: 'https://github.com/wprl/baucis-json/issues/new',
email: '[email protected]' },
homepage: 'https://github.com/wprl/baucis-json',
_id: '[email protected]',
dist:
{ shasum: '3fea8ae954a3984d7fc01464beaa7a186a76c562',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-1.0.0-prerelease.2.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'1.0.0-candidate.0':
{ name: 'baucis-json',
version: '1.0.0-candidate.0',
description: 'Baucis uses this to parse and format streams of JSON.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
peerDependencies: { baucis: '>0.20.0' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land', email: '[email protected]' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
repository: { type: 'git', url: 'https://github.com/wprl/baucis-json.git' },
bugs:
{ url: 'https://github.com/wprl/baucis-json/issues/new',
email: '[email protected]' },
homepage: 'https://github.com/wprl/baucis-json',
_id: '[email protected]',
dist:
{ shasum: '56ae71417d7feb23db5c7a912f6c40614ed3816e',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-1.0.0-candidate.0.tgz' },
_from: '.',
_npmVersion: '1.4.3',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
directories: {} },
'1.0.0-candidate.1':
{ name: 'baucis-json',
version: '1.0.0-candidate.1',
description: 'Baucis uses this to parse and format streams of JSON.',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
keywords: [ 'baucis', 'stream', 'json', 'parse', 'parser', 'format' ],
author: { name: 'William Riley-Land', email: '[email protected]' },
license: 'MIT',
dependencies: { 'event-stream': '~3.1.1' },
repository: { type: 'git', url: 'https://github.com/wprl/baucis-json.git' },
bugs:
{ url: 'https://github.com/wprl/baucis-json/issues/new',
email: '[email protected]' },
homepage: 'https://github.com/wprl/baucis-json',
_id: '[email protected]',
_shasum: '80fb38b32dae0f071311c5e60868b172573daae7',
_from: '.',
_npmVersion: '1.4.9',
_npmUser: { name: 'wprl', email: '[email protected]' },
maintainers: [ [Object] ],
dist:
{ shasum: '80fb38b32dae0f071311c5e60868b172573daae7',
tarball: 'http://registry.npmjs.org/baucis-json/-/baucis-json-1.0.0-candidate.1.tgz' },
directories: {} } }
Do you have any queue ?
Regards.
I'm having problems with the default.nix created by npm2nix - when I'm running it on a system with auto-optimise-store = true, it fails when unpacking sources:
these derivations will be built:
/nix/store/999c0py1dh9myzjnbdmadsk32iq25k4p-ext-sso-2.0.0.tgz.drv
/nix/store/ixkcxny2i78npzf90zvbx8hg6xy6nk2x-nodejs-ext-sso-2.0.0.drv
building path(s) ‘/nix/store/6w7kjrm0svb2bn15l1gqm2c91649sdvj-ext-sso-2.0.0.tgz’
building path(s) ‘/nix/store/al8q629fak0ncj24gilwhki1aprziyk9-nodejs-ext-sso-2.0.0’
unpacking sources
unpacking source archive /nix/store/6w7kjrm0svb2bn15l1gqm2c91649sdvj-ext-sso-2.0.0.tgz
tar: package/sso/preferences/migrations/__init__.py: Cannot hard link to 'yibfgnx42kp1plrrpznafl022bfdrf2n-ext.sso/sso/preferences/__init__.py': No such file or directory
tar: package/sso/apps/migrations/__init__.py: Cannot hard link to 'yibfgnx42kp1plrrpznafl022bfdrf2n-ext.sso/sso/preferences/__init__.py': No such file or directory
(...)
tar: Exiting with failure status due to previous errors
do not know how to unpack source archive /nix/store/6w7kjrm0svb2bn15l1gqm2c91649sdvj-ext-sso-2.0.0.tgz
builder for ‘/nix/store/ixkcxny2i78npzf90zvbx8hg6xy6nk2x-nodejs-ext-sso-2.0.0.drv’ failed with exit code 1
The same command runs fine after setting auto-optimise-store = false (and rebuilding the .tgz).
See https://www.npmjs.org/doc/files/package.json.html#os , npm2nix
should set platforms
appropriately.
When using iojs the generated default.nix should be slightly different, for example:
{ foo ? { outPath = ./.; name = "foo"; }
, pkgs ? import <nixpkgs> {}
}:
let
nodePackages = import "${pkgs.path}/pkgs/top-level/node-packages.nix" {
inherit pkgs;
inherit (pkgs) stdenv fetchurl fetchgit;
nodejs = iojs;
neededNatives = [ pkgs.python ] ++ pkgs.lib.optional pkgs.stdenv.isLinux pkgs.utillinux;
self = nodePackages;
generated = ./packages.nix;
};
in rec {
tarball = pkgs.runCommand "foo.tgz" { buildInputs = [ pkgs.iojs ]; } ''
mv `HOME=$PWD npm pack ${foo}` $out
'';
build = nodePackages.buildNodePackage {
name = "foo";
src = [ tarball ];
buildInputs = nodePackages.nativeDeps."foo" or [];
deps = [];
peerDependencies = [];
};
}
In some rare cases when packages have dot(.) in their names, npm2nix
generates invalid default.nix.
For example:
https://raw.githubusercontent.com/isagalaev/highlight.js/master/package.json
{ highlight.js ? { outPath = ./.; name = "highlight.js"; } ...
error: syntax error, unexpected '?', expecting '.' or '=', at "/tmp/tmp.hz1BdxeD8N/default.nix":1:16
At the (very old!) version of npm-registry-client
used by npm2nix
, URIs are unconditionally uriencoded: https://github.com/npm/npm-registry-client/blob/v0.2.27/lib/request.js#L56
I'm trying to package gitbooks which contains:
"nunjucks": "mozilla/nunjucks#103513c294835bcbe64222de6db494e2555e294e",
which fails with
fatal: reference is not a tree: 103513c294835bcbe64222de6db494e2555e294e
Error during fetch: Error fetching git://github.com/mozilla/nunjucks.git#103513c294835bcbe64222de6db494e2555e294e from git: git checkout exited with non-zero status code 128
I will not be the primary author on npm2nix
moving forward, so probably the copyright notice and package.json should reflect that.
The package hapi-7.5.3
has a file named npm-shrinkwrap.json
at the top-level, this file seems to pin the dependencies to specific versions, even if they are out-dated.
While building with nix-build, npm install
makes multiple request to example.com to fetch different version than the latest, and finally fails at parsing HTML as a valid JSON file.
A temporary work-around consist at removing the file $PWD/npm-shrinkwrap.json
at the end of the configurePhase of buildNodePackage expression.
I'm trying to update node-packages-generated.nix
in nixpkgs, after working for minutes sometimes it gets stuck in ETIMEDOUT
or ECONNRESET
errors.
Perhaps the concurrency at which it downloads info from registry is too high? Is it possible to change it?
It seems to be unmaintained and the widely endorsed replacement is node2nix
. It would probably be good to make that clear in the readme so newcomers don't spend time on something that very few people still use.
I'm running npm2nix on my package.json and it finishes without errors, but I'm getting a file that looks like this :
{ self, fetchurl, fetchgit ? null, lib }:
{
I have node v0.12.2 and npm2nix 5.8.1 installed.
I get the following error:
http 404 https://registry.npmjs.org/%2540iamadamjowett%252Fangular-click-outside
Error during fetch: Could not find version matching ^2.10.1 for @iamadamjowett/angular-click-outside in undefined
The full package.json file:
{
"name": "contacts",
"version": "2.0.1",
"description": "Place this app in **nextcloud/apps/**",
"author": {
"name": "Hendrik Leppelsack",
"email": "[email protected]"
},
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/nextcloud/contacts.git"
},
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/nextcloud/contacts/issues"
},
"homepage": "https://github.com/nextcloud/contacts#readme",
"scripts": {
"test": "node node_modules/gulp-cli/bin/gulp.js karma",
"prebuild": "npm install && npm update",
"build": "node node_modules/gulp-cli/bin/gulp.js",
"scss-compile": "cat build/css/variables.scss css/style.scss | node-sass --include-path css > css/style.css",
"watch": "node node_modules/gulp-cli/bin/gulp.js watch"
},
"devDependencies": {
"angular-mocks": "~1.5.8",
"chai": "^3.5.0",
"codecov": "^1.0.1",
"gulp": "^3.9.1",
"gulp-cli": "^1.2.2",
"gulp-concat": "^2.6.0",
"gulp-eslint": "^3.0.1",
"gulp-ng-annotate": "^2.0.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-stylelint": "^5.0.0",
"karma": "^1.2.0",
"karma-chai": "^0.1.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.1.1",
"karma-mocha-reporter": "^2.1.0",
"karma-sinon": "^1.0.5",
"merge-stream": "^1.0.1",
"mocha": "^3.0.2",
"node-sass": "^4.5.3",
"sinon": "^1.17.5",
"stylelint-config-standard": "^17.0.0",
"underscore": "^1.8.3"
},
"dependencies": {
"@iamadamjowett/angular-click-outside": "^2.10.1",
"angular": "~1.5.8",
"angular-cache": "^4.6.0",
"angular-route": "~1.5.8",
"angular-sanitize": "~1.5.8",
"angular-ui-bootstrap": "^2.5.6",
"angular-uuid4": "^0.3.1",
"jquery-timepicker": "^1.3.3",
"ngclipboard": "^1.1.2",
"ui-select": "^0.19.8",
"vcard-parser": "^0.2.7"
}
}
Any ideas how to fix? I'm not familiar with npm at all.
I'm getting this error while generating a package
fatal: remote error:
github:matrix-org/react-gemini-scrollbar is not a valid repository name
The problem appears to be related to the github URL scheme.
ssbc/patchwork#458 mentions old npm versions as a cause but I have version 3.10 which should support it.
Example json:
[ "d" ]
d depends on es5-ext, which depends on es6-iterator, which depends on both d and es5-ext
package.json:
{ "name": "testing"
, "private" : true
, "dependencies":
{ "fs-ext": "git://github.com/gfxmonk/node-fs-ext.git#4c77f466a42e92e3aee72a68d9fb37b0513cbd35"
}
}
Error output:
# ./node_modules/.bin/npm2nix package.json out.nix
Cloning into 'node-fs-ext'...
remote: Counting objects: 176, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 176 (delta 1), reused 4 (delta 1)
Receiving objects: 100% (176/176), 56.91 KiB | 0 bytes/s, done.
Resolving deltas: 100% (88/88), done.
Checking connectivity... done.
fatal: ambiguous argument 'origin/4c77f466a42e92e3aee72a68d9fb37b0513cbd35': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error during fetch: Error fetching git://github.com/gfxmonk/node-fs-ext.git#4c77f466a42e92e3aee72a68d9fb37b0513cbd35 from git: git rev-parse exited with non-zero status code 128
Note: checking out '4c77f466a42e92e3aee72a68d9fb37b0513cbd35'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 4c77f46... add fcntl to README.md
The error message seems to be coming from git rev-parse
, while the warning about the detached HEAD state seems to be from a (successful) git checkout
of the given commit.
I tried downgrading to version 5.6.0 of npm2nix, and that seems to work for the same package.json
Using node 0.12.0.
When you have a dependency list like the following:
"dependencies": {
"mymodule": "./node_modules/mymodule",
"jquery": "~1.11.1",
},
You get an error like this:
Error during fetch: Error fetching git://github.com/./node_modules/mymodule from git: Error executing git clone: Error: spawn git ENOENT
Have also tried with the following:
"dependencies": {
"mymodule": "file:./node_modules/mymodule",
"jquery": "~1.11.1",
},
See https://www.npmjs.org/doc/files/package.json.html#optionaldependencies . Especially usefuil if #6 is implemented, as there may be some dependency that can't be provided on a given platform.
Hi, npm2nix seems to be failing on the jsbn module, perhaps because it's a git repo type module, but I'm not sure.
git clone [email protected]:NixOS/npm2nix.git
cd npm2nix
nix-shell
rm -rf ~/.npm
node --version > output.txt
git --version >> output.txt
node lib/command.js package.json node-packages-generated.nix >> output.txt 2>&1
Result: output.txt
...
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Error during fetch: Error fetching https://github.com/rynomad/jsbn.git from git: git rev-parse's stdout ended before 64 characters were read
Cheers
Just tried to apply npm2nix on Abricotine.
May it be, that npm2nix has troubles with that @
in the dependency name?
npm2nix package.json default.nix
...
Error during fetch: Could not find version matching ^0.9.2 for @shagstrom/split-pane in undefined
I don't know who has access to npm. I currently maintain all node stuff, so i would need a new release. Currently git release is used in nixpkgs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.