question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

postinstall not working in npm 7.x

See original GitHub issue

Versions

  • NodeJS: 14.16.0
  • npm: 7.8.0
  • mongodb-memory-server: 6.9.6
  • system: MacOS

package: mongo-memory-server

What is the Problem?

No binaries of mongodb are downloaded on npm install. Setting"disablePostinstall": "0" in the packege.json makes no difference

My package.json (striped):

{
  "name": "***",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
  },
  "config": {
    "mongodbMemoryServer": {
      "version": "4.4.5",
      "debug": "1"
    }
  },
  "dependencies": {
    "@nestjs/common": "^7.6.15",
    "@nestjs/core": "^7.6.15",
    "@nestjs/graphql": "^7.10.3",
    "@nestjs/mapped-types": "*",
    "@nestjs/mongoose": "^7.2.4",
    "@nestjs/platform-express": "^7.6.15",
    "apollo-server-express": "^2.22.2",
    "graphql": "^15.5.0",
    "graphql-tools": "^4.0.8",
    "lodash": "^4.17.21",
    "mongoose": "^5.12.3",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^6.6.6"
  },
  "devDependencies": {
    "@nestjs/cli": "^7.6.0",
    "@nestjs/schematics": "^7.3.0",
    "@nestjs/testing": "^7.6.15",
    "@types/express": "^4.17.11",
    "@types/jest": "^26.0.22",
    "@types/node": "^14.14.36",
    "@types/supertest": "^2.0.10",
    "@typescript-eslint/eslint-plugin": "^4.19.0",
    "@typescript-eslint/parser": "^4.19.0",
    "eslint": "^7.22.0",
    "eslint-config-prettier": "^8.1.0",
    "eslint-plugin-prettier": "^3.3.1",
    "jest": "^26.6.3",
    "mongodb-memory-server": "^6.9.6",
    "prettier": "^2.2.1",
    "supertest": "^6.1.3",
    "ts-jest": "^26.5.4",
    "ts-loader": "^8.0.18",
    "ts-node": "^9.1.1",
    "tsconfig-paths": "^3.9.0",
    "typescript": "^4.2.3"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

Do you know why it happenes?

no

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22

github_iconTop GitHub Comments

1reaction
hasezoeycommented, Jun 1, 2021

@seahindeniz thanks for reporting, made an clear issue stating the problem, #478

0reactions
nidomirocommented, Jun 9, 2021

Currently I have npm 7.13.0 installed and it seems to work without the workaround 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

postinstall isn't executing in npm@7 · Issue #776 - GitHub
I am running into this as well, except updating to the beta version is not working in my case. This is on Node...
Read more >
NPM not running postinstall - node.js - Stack Overflow
I've installed a custom package called @company/cdk-library. It has package.json scripts: "scripts": { "test": "jest", "build": "tsc", ...
Read more >
patch-package - npm
Fix broken node modules with no fuss. Latest version: 6.5.0, ... Start using patch-package in your project by running `npm i patch-package`.
Read more >
npm-ci
Run all build scripts (ie, preinstall , install , and postinstall ) scripts for installed packages in the foreground process, sharing standard input,...
Read more >
scripts | npm Docs
Runs BEFORE a tarball is packed (on " npm pack ", " npm publish ", and when installing a git dependencies). NOTE: "...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found