Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
2ae9c79f
Commit
2ae9c79f
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Make mesh npm install similar to previous methos
parent
d2e907e5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-utils-nodejs
+46
-25
46 additions, 25 deletions
src/freedombone-utils-nodejs
with
46 additions
and
25 deletions
src/freedombone-utils-nodejs
+
46
−
25
View file @
2ae9c79f
...
...
@@ -68,8 +68,31 @@ function mesh_install_nodejs {
fi
mesh_install_nodejs_prefix
=
"chroot
$rootdir
"
fi
$mesh_install_nodejs_prefix
apt-get
-yq
install
g++ m4 libtool automake nodejs curl
$mesh_install_nodejs_prefix
apt-get
-qy
install
wget curl g++ m4 libtool automake
$mesh_install_nodejs_prefix
apt-get
-yq
install
libxext-dev libxtst-dev libxkbfile-dev
$mesh_install_nodejs_prefix
wget
-qO-
https://deb.nodesource.com/gpgkey/nodesource.gpg.key
>
/root/node.gpg.key
$mesh_install_nodejs_prefix
apt-key add /root/node.gpg.key
echo
"deb https://deb.nodesource.com/node_6.x stretch main"
>
$rootdir
/etc/apt/sources.list.d/nodesource.list
echo
"deb-src https://deb.nodesource.com/node_6.x stretch main"
>>
$rootdir
/etc/apt/sources.list.d/nodesource.list
$mesh_install_nodejs_prefix
apt-get update
$mesh_install_nodejs_prefix
apt-get
-yq
remove
--purge
nodejs
if
[
-d
$rootdir
/usr/local/lib/node_modules
]
;
then
rm
-rf
$rootdir
/usr/local/lib/node_modules
fi
if
[
-f
$rootdir
/usr/local/bin/node
]
;
then
rm
$rootdir
/usr/local/bin/node
fi
if
[
-f
$rootdir
/usr/bin/node
]
;
then
rm
/usr/bin/node
fi
if
[
-f
$rootdir
/usr/bin/nodejs
]
;
then
rm
$rootdir
/usr/bin/nodejs
fi
$mesh_install_nodejs_prefix
apt-get
-yq
install
nodejs
if
[
!
-f
${
rootdir
}
/usr/bin/nodejs
]
;
then
echo
$'nodejs was not installed'
...
...
@@ -85,28 +108,33 @@ function mesh_install_nodejs {
exit
7235728
fi
$mesh_install_nodejs_prefix
apt-get
-qy
install
wget
$mesh_install_nodejs_prefix
wget https://www.npmjs.com/install.sh
-O
/root/npm_install.sh
if
[
!
-f
$rootdir
/root/npm_install.sh
]
;
then
echo
$'Unable to download npm installer'
exit
8793636
fi
if
!
grep
-q
"t=
\"\$
{npm_install}
\"
"
$rootdir
/root/npm_install.sh
;
then
echo
$'Unable to set npm version within npm_install.sh'
exit
629052
fi
$mesh_install_nodejs_prefix
chmod
+x /root/npm_install.sh
$mesh_install_nodejs_prefix
sed
-i
"s|t=
\"\$
{npm_install}
\"
|t=
\"
$NPM_VERSION
\"
|g"
/root/npm_install.sh
$mesh_install_nodejs_prefix
/root/npm_install.sh
#$mesh_install_nodejs_prefix wget https://www.npmjs.com/install.sh -O /root/npm_install.sh
#if [ ! -f $rootdir/root/npm_install.sh ]; then
# echo $'Unable to download npm installer'
# exit 8793636
#fi
#if ! grep -q "t=\"\${npm_install}\"" $rootdir/root/npm_install.sh; then
# echo $'Unable to set npm version within npm_install.sh'
# exit 629052
#fi
#$mesh_install_nodejs_prefix chmod +x /root/npm_install.sh
#$mesh_install_nodejs_prefix sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" /root/npm_install.sh
#$mesh_install_nodejs_prefix /root/npm_install.sh
#
#if [ ! -f $rootdir/usr/bin/npm ]; then
# echo $'npm was not installed'
# exit 5290462
#fi
#cp $rootdir/usr/bin/npm $rootdir/root/npm
if
[
!
-f
$rootdir
/usr/bin/npm
]
;
then
echo
$'npm was not installed'
exit
5290462
get_npm_arch
$mesh_install_nodejs_prefix
npm
install
--arch
=
$NPM_ARCH
-g
npm@
${
NPM_VERSION
}
--save
if
[
-f
$rootdir
/usr/local/bin/npm
]
;
then
cp
$rootdir
/usr/local/bin/npm /usr/bin/npm
fi
cp
$rootdir
/usr/bin/npm
$rootdir
/root/npm
# update from the old debian nodejs version
get_npm_arch
$mesh_install_nodejs_prefix
npm
install
--arch
=
$NPM_ARCH
-g
n@
${
NODEJS_N_VERSION
}
--save
$mesh_install_nodejs_prefix
n
--arch
$N_ARCH
${
NODEJS_VERSION
}
cp
$rootdir
/root/npm
$rootdir
/usr/bin/npm
...
...
@@ -189,7 +217,6 @@ function install_nodejs {
#if [ ! -f /usr/bin/nodejs ]; then
# Note: this has to be jessie for now
# wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > /root/node.gpg.key
# apt-key add /root/node.gpg.key
# echo "deb https://deb.nodesource.com/node_6.x stretch main" > /etc/apt/sources.list.d/nodesource.list
...
...
@@ -227,12 +254,6 @@ function install_nodejs {
#npm install -g pug@2.0.0-beta6 --save
#npm install -g graceful-fs@4.1.10 --save
#npm install -g minimatch@3.0.3 --save
npm
install
-g
npm@
${
NPM_VERSION
}
--save
#cp /usr/local/bin/node /usr/bin/nodejs
if
[
-f
/usr/local/bin/npm
]
;
then
cp
/usr/local/bin/npm /usr/bin/npm
fi
# node seems tricky so here we're going to double check
# that the versions we expect did get installed
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment