Actions

Difference between revisions of "Packaging NPM"

From HacDC Wiki

 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Byzantium]]
* Ensure that [http://nodejs.org/ node.js] is installed and operable.
* Ensure that [http://nodejs.org/ node.js] is installed and operable.
** Download the latest .tar.gz tarball of the node.js source code.
** Note that it is necessary to install node.js and npm on the build system to build the packages.** Download the latest .tar.gz tarball of the node.js source code.
** '''cd /tmp'''
** '''cd /tmp'''
** '''tar xvfz /path/to/node-vx.y.z.tar.gz'''
** '''tar xvfz /path/to/node-vx.y.z.tar.gz'''
Line 6: Line 7:
** '''./configure -p --prefix=/usr'''
** '''./configure -p --prefix=/usr'''
** '''make'''
** '''make'''
** '''make test'''
** '''make install DESTDIR=/tmp/nodejs-vx.y.z'''
** '''make install DESTDIR=/tmp/nodejs-vx.y.z'''
* Download npm: '''wget http://npmjs.org/install.sh'''
** '''dir2xzm /tmp/nodejs-vx.y.z /tmp/node-x.y.z.xzm'''
* '''mv install.sh npm-install.sh'''
* Download the source to npm [https://github.com/isaacs/npm/zipball/master from Github].
* '''sh ./npm-install.sh''' (as root)
* '''unzip isaacs-npm-...zip'''
* Everything goes in /usr/lib/mode_modules/npm
* '''cd isaacs-npm-...'''
* /usr/bin/npm* symlinked to /usr/lib/mode_modules/npm/bin/npm.js
* '''make'''
* '''make install'''
** '''mkdir -p /tmp/npm-x.y.z/usr'''
** '''export npm_config_userconfig=./npmrc'''
** '''node cli.js config set cache /tmp/npm-cache'''
** '''node cli.js config set prefix /tmp/npm-x.y.z/usr'''
** '''node cli.js config set unsafe-perm true'''
** '''node cli.js install -g .'''
** '''dir2xzm /tmp/npm-x.y.z /tmp/npm-x.y.z.xzm'''
* Everything goes in ''/usr/lib/mode_modules/npm''.
* ''/usr/bin/npm*'' are symlinked to ''/usr/lib/mode_modules/npm/bin/npm.js''.

Latest revision as of 14:04, 3 April 2012

  • Ensure that node.js is installed and operable.
    • Note that it is necessary to install node.js and npm on the build system to build the packages.** Download the latest .tar.gz tarball of the node.js source code.
    • cd /tmp
    • tar xvfz /path/to/node-vx.y.z.tar.gz
    • cd node-vx.y.z
    • ./configure -p --prefix=/usr
    • make
    • make test
    • make install DESTDIR=/tmp/nodejs-vx.y.z
    • dir2xzm /tmp/nodejs-vx.y.z /tmp/node-x.y.z.xzm
  • Download the source to npm from Github.
  • unzip isaacs-npm-...zip
  • cd isaacs-npm-...
  • make
  • make install
    • mkdir -p /tmp/npm-x.y.z/usr
    • export npm_config_userconfig=./npmrc
    • node cli.js config set cache /tmp/npm-cache
    • node cli.js config set prefix /tmp/npm-x.y.z/usr
    • node cli.js config set unsafe-perm true
    • node cli.js install -g .
    • dir2xzm /tmp/npm-x.y.z /tmp/npm-x.y.z.xzm
  • Everything goes in /usr/lib/mode_modules/npm.
  • /usr/bin/npm* are symlinked to /usr/lib/mode_modules/npm/bin/npm.js.