npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Module binaries missing in CI

Hello! I’m having problems running npm scripts in ci.

/package.json:

{
  "scripts": {
    "postinstall": "cd public && npm install",
    "build:client": "cd public && npm run build",
    "build": "run-s build:**",
  },
  "devDependencies": {
    "npm-run-all": "^4.1.3",
  }
}

public/package.json

{
  "scripts": {
    "build": "run-s clean build:*",
    "build:app": "rollup --config",
    "build:serviceworker": "workbox injectManifest workbox-config.js",
  },
  "devDependencies": {
    "npm-run-all": "^4.1.3",
  }
}

This runs fine locally, but when I run in ci I get:

sh: run-s: not found

So far I’ve tried changing the ci command from npm ci to npm install with no change.

I’m using gitlab-ci.

I’ve added echo "unsafe-perm=true" > ~/.npmrc to my CI scripts before running any npm stuff, in order to get postinstall working. Could that be involved?


Seems like this was a CI config problem. I explicitly cached node_modules between CI stages and that solved it. :muscle: