postinstall-build icon indicating copy to clipboard operation
postinstall-build copied to clipboard

Issue installing with [email protected]

Open OmgImAlexis opened this issue 8 years ago • 3 comments

I have "postinstall-build": "^5.0.0", in the dependencies array. I'm using [email protected]. I tried this with yarn instead of npm and was getting more errors. I have [email protected] and [email protected].

➜  twistly-api git:(master) ✗ npm install --production

> [email protected] install /Users/xo/code/twistly-api/node_modules/dtrace-provider
> node scripts/install.js


> [email protected] postinstall /Users/xo/code/twistly-api
> postinstall-build dist

postinstall-build:
  This version of npm (5.0.3) may not be compatible with postinstall-build! There
  are outstanding bugs in certain versions of npm that prevent it from working with
  postinstall-build. See https://github.com/exogen/postinstall-build#bugs-in-npm
  for more information.


> [email protected] install /Users/xo/code/twistly-api/node_modules/fsevents
> node install

[fsevents] Success: "/Users/xo/code/twistly-api/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] postinstall /Users/xo/code/twistly-api
> postinstall-build dist

sh: postinstall-build: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `postinstall-build dist`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xo/.npm/_logs/2017-07-05T05_09_46_247Z-debug.log
postinstall-build:
  Error: Command failed: sh -c "/usr/local/Cellar/node/8.1.3/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" install --only=dev


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `postinstall-build dist`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xo/.npm/_logs/2017-07-05T05_09_46_552Z-debug.log

Excerpt from my package.json.

{
    "name": "twistly",
    "version": "1.0.0",
    "description": "Twistly",
    "private": true,
    "scripts": {
        "clean-dist": "rm -rf dist && mkdir dist",
        "build": "npm run clean-dist && babel ./src -d ./dist -s",
        "lint": "xo",
        "test": "nyc ava test/**/*.spec.js",
        "postinstall": "postinstall-build dist",
        "start": "node MODE=worker ./dist/index.js"
    },
    "dependencies": {
        "agenda": "^0.9.1",
        "async": "^1.5.2",
        "bcryptjs": "^2.4.3",
        "body-parser": "^1.15.0",
        "bunyan": "^1.8.10",
        "configstore": "^3.1.0",
        "cross-env": "^4.0.0",
        "dumb-passwords": "^0.2.1",
        "express": "^4.13.4",
        "express-api-error-handler": "^1.1.0",
        "express-healthcheck": "^0.1.0",
        "express-jwt": "^5.1.0",
        "express-session": "^1.15.3",
        "hat": "^0.0.3",
        "http-errors": "^1.6.1",
        "joi": "^10.5.0",
        "jsonwebtoken": "^7.3.0",
        "loud-rejection": "^1.6.0",
        "meow": "^3.7.0",
        "method-override": "^2.3.3",
        "mongoose": "^4.4.6",
        "numeral": "^2.0.6",
        "passport": "^0.3.2",
        "passport-tumblr": "^0.1.2",
        "postinstall-build": "^5.0.0",
        "tumblr.js": "0.0.7"
    },
    "devDependencies": {
        "ava": "^0.19.1",
        "babel-cli": "^6.24.0",
        "babel-core": "^6.24.0",
        "babel-plugin-stack-trace-sourcemap": "^1.0.2",
        "babel-plugin-transform-runtime": "^6.23.0",
        "babel-preset-es2015": "^6.24.0",
        "babel-preset-stage-2": "^6.22.0",
        "babel-watch": "^2.0.6",
        "coveralls": "^2.13.0",
        "nyc": "^10.2.0",
        "snyk": "1.16.0",
        "supertest": "^3.0.0",
        "xo": "^0.18.2"
    },
    "buildDependencies": {
        "babel-cli": "^6.24.0",
        "babel-core": "^6.24.0",
        "babel-plugin-stack-trace-sourcemap": "^1.0.2",
        "babel-plugin-transform-runtime": "^6.23.0",
        "babel-preset-es2015": "^6.24.0",
        "babel-preset-stage-2": "^6.22.0"
    }
}

OmgImAlexis avatar Jul 05 '17 05:07 OmgImAlexis

Thanks for the report! npm v5 definitely has issues with postinstall-build at the moment; I haven't done enough testing to find all of its failure modes yet. I'll do some testing to see if this is an issue specific to npm v5.

exogen avatar Jul 05 '17 20:07 exogen

@OmgImAlexis Did you find a workaround ?

bilby91 avatar Aug 24 '17 14:08 bilby91

I would also like to know, it throws me an error with npm 5.6.0, but it works perfectly with yarn

hamza-hajji avatar Feb 16 '18 16:02 hamza-hajji