Actions

Packaging NPM.: Difference between revisions

From HacDC Wiki

(Created page with "I'm basing the process off of [http://aur.archlinux.org/packages/no/nodejs-npm/PKGBUILD the Arch Linux AUR for NPM], which does pretty much the same thing. * su - * rm -rf /tmp/...")
 
No edit summary
Line 10: Line 10:
* wget <URL of latest version of NPM>
* wget <URL of latest version of NPM>
* tar xvfz npm-x.y.z.tar.gz
* tar xvfz npm-x.y.z.tar.gz
*
* node package/cli.js config set unsafe-perm true
* node package/cli.js config set prefix /tmp/fakeroot/usr
* node package/cli.js install -g ./npm-x.y.z.tar.gz
* node package/cli.js config set prefix /usr
* node package/cli.js config set unsafe-perm false
* cp -r package/html/ /tmp/fakeroot/usr/share/doc/npm
* install -m 644 package/LICENSE /tmp/fakeroot/usr/share/licenses/npm/
* dir2xzm /tmp/fakeroot /tmp/npm-x.y.z.xzm

Revision as of 00:14, 18 October 2011

I'm basing the process off of the Arch Linux AUR for NPM, which does pretty much the same thing.

  • su -
  • rm -rf /tmp/fakeroot
  • mkdir -p /tmp/fakeroot
  • curl -SsL http://registry.npmjs.org/npm/ | sed -e 's/^.*tarball":"//' -e 's/".*$//'
    • This results in the URL of the latest version of NPM available.
  • mkdir -p /tmp/fakeroot/usr/share/{doc,licenses/npm}
  • cd /tmp
  • wget <URL of latest version of NPM>
  • tar xvfz npm-x.y.z.tar.gz
  • node package/cli.js config set unsafe-perm true
  • node package/cli.js config set prefix /tmp/fakeroot/usr
  • node package/cli.js install -g ./npm-x.y.z.tar.gz
  • node package/cli.js config set prefix /usr
  • node package/cli.js config set unsafe-perm false
  • cp -r package/html/ /tmp/fakeroot/usr/share/doc/npm
  • install -m 644 package/LICENSE /tmp/fakeroot/usr/share/licenses/npm/
  • dir2xzm /tmp/fakeroot /tmp/npm-x.y.z.xzm