|
@@ -43,6 +43,16 @@ NPM_VERSION='4.0.5'
|
43
|
43
|
# so that it can be removed if tere are no apps which need it
|
44
|
44
|
NODEJS_INSTALLED_APPS_FILE=$HOME/.nodejs-apps
|
45
|
45
|
|
|
46
|
+function get_npm_arch {
|
|
47
|
+ NPM_ARCH='ia32'
|
|
48
|
+ if [[ $ARCHITECTURE == 'arm'* ]]; then
|
|
49
|
+ NPM_ARCH='armv7l'
|
|
50
|
+ fi
|
|
51
|
+ if [[ $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'amd64' ]]; then
|
|
52
|
+ NPM_ARCH='x64'
|
|
53
|
+ fi
|
|
54
|
+}
|
|
55
|
+
|
46
|
56
|
function mesh_install_nodejs {
|
47
|
57
|
chroot "$rootdir" apt-get -yq install g++ m4 libtool automake nodejs curl
|
48
|
58
|
chroot "$rootdir" apt-get -yq install libxext-dev libxtst-dev libxkbfile-dev
|
|
@@ -73,6 +83,14 @@ function mesh_install_nodejs {
|
73
|
83
|
sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh
|
74
|
84
|
chroot "$rootdir" /root/npm_install.sh
|
75
|
85
|
fi
|
|
86
|
+ if [ ! -f $rootdir/usr/bin/npm ]; then
|
|
87
|
+ echo $'npm was not installed'
|
|
88
|
+ exit 5290462
|
|
89
|
+ fi
|
|
90
|
+
|
|
91
|
+ # update from the old debian nodejs version
|
|
92
|
+ get_npm_arch
|
|
93
|
+ chroot "$rootdir" npm install --arch=$NPM_ARCH node@$NODEJS_VERSION -g
|
76
|
94
|
}
|
77
|
95
|
|
78
|
96
|
function remove_nodejs {
|