From 231a58218fb2a7b906431155d555e81bb96bad11 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 23 Jun 2015 02:03:09 -0400 Subject: building npm: Yell if you try to package npm@3 with npm@2 npm@2's packager can't handle npm@3's bundled node_modules, so you either have to use a version that we've built for you (eg one published to the registry) or use the one that you're building. --- scripts/installable.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/installable.sh (limited to 'scripts') diff --git a/scripts/installable.sh b/scripts/installable.sh new file mode 100644 index 000000000..1d5a90c29 --- /dev/null +++ b/scripts/installable.sh @@ -0,0 +1,13 @@ +#!/bin/bash +npmver=$(perl -E "say q{$npm_config_user_agent} =~ m{/(\S+)}") + +if semver -r ^3.0.0-0 $npmver > /dev/null; then + echo "Packaging with $npmver" +else + echo "Packaging or installing npm@$npm_package_version with npm@$npmver is impossible." 1>&2 + echo "Please install npm@^3.0.0-0 from the registry and use that or run your command with" 1>&2 + echo "this version of npm with:" 1>&2 + npmargs=$(node -e "a=$npm_config_argv; console.log(a.original.join(' '))") + echo " $npm_node_execpath $PWD $npmargs" 1>&2 + exit 1 +fi -- cgit v1.2.3