GitHub Actions: Error: Cannot find module 'path-scurry'
timheerwagen opened this issue · 4 comments
Hello, thank you very much for the great package.
In a GitHub Actions run with the new 5.0.0 version I encounter the following error: Error: Cannot find module 'path-scurry'
. Locally, however, it works. I also tried clean install, deleting node_modules etc.
Workflow:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: NodeJs aufsetzen
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
# NPM ci mit Cache
- name: Cache dependencies
uses: actions/cache@v3
id: npm-cache
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build
run: rimraf dist && tsup
...
Error log:
• Packages in scope: ...
• Running pre-release in 1 packages
• Remote caching disabled
pre-release: cache miss, executing 3b10509691a05be[4](...#step:7:5)
pre-release: > npm run clean && tsup
pre-release:
pre-release:
pre-release: >
pre-release: > rimraf dist
pre-release:
pre-release: node:internal/modules/cjs/loader:1078
pre-release: throw err;
pre-release: ^
pre-release:
pre-release: Error: Cannot find module 'path-scurry'
pre-release: Require stack:
pre-release: - /home/runner/work/packages/cms/node_modules/glob/dist/cjs/src/glob.js
pre-release: - /home/runner/work/packages/cms/node_modules/glob/dist/cjs/src/index.js
pre-release: - /home/runner/work/packages/cms/node_modules/rimraf/dist/cjs/src/index.js
pre-release: - /home/runner/work/packages/cms/node_modules/rimraf/dist/cjs/src/bin.js
pre-release: at Module._resolveFilename (node:internal/modules/cjs/loader:107[5](...#step:7:6):15)
pre-release: at Module._load (node:internal/modules/cjs/loader:920:27)
pre-release: at Module.require (node:internal/modules/cjs/loader:1141:19)
pre-release: at require (node:internal/modules/cjs/helpers:110:18)
pre-release: at Object.<anonymous> (/home/runner/work/packages/cms/node_modules/glob/dist/cjs/src/glob.js:5:23)
pre-release: at Module._compile (node:internal/modules/cjs/loader:1254:14)
pre-release: at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
pre-release: at Module.load (node:internal/modules/cjs/loader:1117:32)
pre-release: at Module._load (node:internal/modules/cjs/loader:958:12)
pre-release: at Module.require (node:internal/modules/cjs/loader:1141:19) {
pre-release: code: 'MODULE_NOT_FOUND',
pre-release: requireStack: [
pre-release: '/home/runner/work/packages/cms/node_modules/glob/dist/cjs/src/glob.js',
pre-release: '/home/runner/work/packages/cms/node_modules/glob/dist/cjs/src/index.js',
pre-release: '/home/runner/work/packages/cms/node_modules/rimraf/dist/cjs/src/index.js',
pre-release: '/home/runner/work/packages/cms/node_modules/rimraf/dist/cjs/src/bin.js'
pre-release: ]
pre-release: }
pre-release:
pre-release: Node.js v18.1[6](...#step:7:7).0
pre-release: npm ERR! Lifecycle script `clean` failed with error:
pre-release: npm ERR! Error: command failed
pre-release: npm ERR! in workspace: ...
pre-release: npm ERR! at location: /home/runner/work/packages/cms
pre-release: npm ERR! Lifecycle script `pre-release` failed with error:
pre-release: npm ERR! Error: command failed
pre-release: npm ERR! in workspace: ...
pre-release: npm ERR! at location: /home/runner/work/packages/cms
pre-release: ERROR: command finished with error: command (/home/runner/work/packages/cms) npm run pre-release exited (1)
command (/home/runner/work/packages/cms) npm run pre-release exited (1)
ERROR run failed: command exited (1)
Tasks: 0 successful, 1 total
Cached: 0 cached, 1 total
Time: [7](...#step:7:8)2[8](...#step:7:9)ms
My current workaround is to use version 4.4.1.
I hope this helps in some way.
That's pretty weird.
I wonder if it has to do with the cached node_modules? Can you try removing that step, and see if a slower fresh npm ci
still triggers the issue?
The cache is not accessed because no run with these node_modules has been successful so far. So it was a fresh npm ci
. Sorry if this step caused confusion.
Run actions/cache@v3 with: path: ./node_modules key: modules-ea3483f98c216022299db0ef1f29b225c818e92b5b81dcdbcb6dd5c3ec5427f7 enableCrossOsArchive: false fail-on-cache-miss: false lookup-only: false Cache not found for input keys: modules-ea3483f98c216022299db0ef1f29b225c818e92b5b81dcdbcb6dd5c3ec5427f7
Hm, yeah, that's true.
Can you add a step just for debugging, that does npm ls path-scurry glob
, and share the output from that run?
@ /home/runner/work
├─┬ @1.0.0-alpha.8 -> ./packages/
│ ├─┬ bcrypt@5.1.0
│ │ └─┬ @mapbox/node-pre-gyp@1.0.10
│ │ └─┬ rimraf@3.0.2
│ │ └── glob@7.1.7 deduped
│ ├─┬ rimraf@5.0.0
│ │ └─┬ glob@10.2.2
│ │ └── path-scurry@1.7.0
│ ├─┬ semantic-release@21.0.2
│ │ └─┬ @semantic-release/npm@10.0.3
│ │ └─┬ npm@9.6.5
│ │ ├─┬ @npmcli/map-workspaces@3.0.3
│ │ │ └── glob@9.3.2 deduped
│ │ ├─┬ cacache@17.0.5
│ │ │ └── glob@9.3.2 deduped
│ │ ├─┬ glob@9.3.2
│ │ │ └── path-scurry@1.6.3
│ │ ├─┬ node-gyp@9.3.1
│ │ │ ├── glob@7.2.3
│ │ │ ├─┬ make-fetch-happen@10.2.1
│ │ │ │ └─┬ cacache@16.1.3
│ │ │ │ └── glob@8.1.0
│ │ │ └─┬ rimraf@3.0.2
│ │ │ └── glob@7.2.3
│ │ └─┬ read-package-json@6.0.1
│ │ └── glob@9.3.2 deduped
│ └─┬ tailwindcss@3.3.2
│ └─┬ sucrase@3.32.0
│ └── glob@7.1.6
├─┬ @eslint-config-custom@1.0.1
│ └─┬ eslint-config-next@12.3.4
│ ├─┬ @next/eslint-plugin-next@12.3.4
│ │ └── glob@7.1.7
│ └─┬ eslint-import-resolver-typescript@2.7.1
│ └── glob@7.2.3
└─┬ test-consumer-app@0.1.0 -> ./apps/test-consumer-app
└─┬ eslint-config-next@13.3.1
└─┬ @next/eslint-plugin-next@13.3.1
└── glob@7.1.7 deduped
However, I can no longer reproduce the error, even though I haven't changed anything in the meantime. So I assume that the error did not lie with rimraf. Thank you very much for your support.