Anyone here familiar with driving nodejs and npm?

I'm trying to write an ebuild for a musicbrainz mirror server and "npm
install" keeps erroring out with one of two errors:

1. The install does finish but npm doesn't get around to exiting,
verified by stopping the emerge, running npm install manually and seeing
that it does nothing. When it stalls strace shows the last call was
(poll,<number>    ), which implies a race condition.

2. More and more often now I get the dreaded "npm: ERR! cb() never
called!" error message which Google and stackoverflow say has been an
ongoing issue for 3 years now. If I keep retrying it eventually
succeeds, implying a race condition of some sort.

I do this in src_prepare():  [1]
src_prepare() {
    npm install npm || die
    npm install || die
}
following the lead of the ony other ebuild in the tree that does npm
install - bokeh-0.7.1

The package.json file from musicbrainz.com is this, it looks OK to me:

{
  "name": "musicbrainz-server",
  "version": "0.0.0",
  "description": "package.json for keeping track of musicbrainz-server
nodejs dependencies",
  "repository": {
    "type": "git",
    "url": "https://github.com/metabrainz/musicbrainz-server.git";
  },
  "license": "GPLv2+",
  "dependencies": {
    "aclass": "0.5.1",
    "babel": "^5.8.21",
    "babel-core": "^5.8.22",
    "babelify": "^6.1.3",
    "balanced-match": "0.2.0",
    "cookie": "^0.1.2",
    "envify": "^3.4.0",
    "filesize": "2.0.4",
    "gulp": "^3.8.7",
    "gulp-less": "^3.0.0",
    "gulp-rev": "^2.0.1",
    "gulp-streamify": "^0.0.5",
    "immutable": "3.6.4",
    "jed": "1.1.0",
    "jquery": "1.11.2",
    "jquery.browser": "gabceb/jquery-browser-plugin#e4a01fd",
    "knockout": "mwiencek/knockout#a8f12df",
    "knockout-arraytransforms": "^2.0.0",
    "less-plugin-clean-css": "^1.4.0",
    "leven": "^1.0.2",
    "lodash": "^3.9.3",
    "parse-stack": "0.1.3",
    "po2json": "^0.3.2",
    "q": "^1.1.1",
    "rcss": "0.1.4",
    "react": "0.13.1",
    "shelljs": "^0.3.0",
    "tablesorter": "Mottie/tablesorter#430f8c5",
    "through2": "^0.6.1",
    "uglifyify": "^3.0.1",
    "vinyl": "^0.4.6",
    "vinyl-source-stream": "^1.0.0",
    "yarb": "^0.4.4"
  },
  "devDependencies": {
    "eslint": "^0.24.0",
    "eslint-plugin-react": "^2.6.4",
    "gulp-watch": "^4.2.1",
    "tape": "^4.0.0"
  },
  "private": true
}


-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to