Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error: Cannot find module '@ast-grep/napi-linux-x64-musl' #5143

Closed
linaaaqi opened this issue Dec 25, 2023 · 3 comments
Closed

[Bug]: Error: Cannot find module '@ast-grep/napi-linux-x64-musl' #5143

linaaaqi opened this issue Dec 25, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@linaaaqi
Copy link

linaaaqi commented Dec 25, 2023

版本信息

  Docker:
    image: node:lts-alpine
  npmPackages:
    @modern-js/eslint-config: 2.43.0 => 2.43.0 
    @modern-js/monorepo-tools: 2.43.0 => 2.43.0 
    @modern-js/plugin-swc: 2.43.0 => 2.43.0 
    @modern-js/plugin-testing: ^2.43.0 => 2.43.0 
    @modern-js/tsconfig: 2.43.0 => 2.43.0

问题详情

I will got errors when run build in Gitlab CI. errors:

$ pnpm i
Scope: all 9 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
Packages: +1304
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1304, reused 0, downloaded 71, added 71
Progress: resolved 1304, reused 0, downloaded 173, added 173
Progress: resolved 1304, reused 0, downloaded 207, added 208
Progress: resolved 1304, reused 0, downloaded 257, added 258
Progress: resolved 1304, reused 0, downloaded 354, added 357
Progress: resolved 1304, reused 0, downloaded 449, added 455
Progress: resolved 1304, reused 0, downloaded 497, added 503
Progress: resolved 1304, reused 0, downloaded 506, added 515
Progress: resolved 1304, reused 0, downloaded 555, added 567
Progress: resolved 1304, reused 0, downloaded 633, added 645
Progress: resolved 1304, reused 0, downloaded 672, added 684
Progress: resolved 1304, reused 0, downloaded 744, added 758
Progress: resolved 1304, reused 0, downloaded 749, added 764
Progress: resolved 1304, reused 0, downloaded 761, added 776
Progress: resolved 1304, reused 0, downloaded 799, added 814
Progress: resolved 1304, reused 0, downloaded 824, added 839
Progress: resolved 1304, reused 0, downloaded 831, added 846
Progress: resolved 1304, reused 0, downloaded 846, added 861
Progress: resolved 1304, reused 0, downloaded 893, added 908
Progress: resolved 1304, reused 0, downloaded 997, added 1012
Progress: resolved 1304, reused 0, downloaded 1050, added 1065
Progress: resolved 1304, reused 0, downloaded 1116, added 1131
Progress: resolved 1304, reused 0, downloaded 1243, added 1259
Progress: resolved 1304, reused 0, downloaded 1275, added 1291
Progress: resolved 1304, reused 0, downloaded 1281, added 1298
Progress: resolved 1304, reused 0, downloaded 1286, added 1303
Progress: resolved 1304, reused 0, downloaded 1287, added 1303
Progress: resolved 1304, reused 0, downloaded 1287, added 1304, done
.../[email protected]/node_modules/core-js postinstall$ node -e "try{require('./postinstall')}catch(e){}"
.../[email protected]/node_modules/core-js postinstall: Done
.../[email protected]/node_modules/esbuild postinstall$ node install.js
.../[email protected]/node_modules/esbuild postinstall$ node install.js
.../[email protected]/node_modules/esbuild postinstall: Done
.../[email protected]/node_modules/esbuild postinstall: Done
devDependencies:
+ @modern-js-app/eslint-config 2.43.0
+ @modern-js/eslint-config 2.43.0
+ @modern-js/monorepo-tools 2.43.0
+ @modern-js/plugin-swc 2.43.0
+ @modern-js/plugin-testing 2.43.0
+ @modern-js/tsconfig 2.43.0
+ husky 8.0.0
+ lint-staged 13.1.0
+ prettier 2.6.2
The dependency was already listed in devDependencies.
If you want to make it a prod dependency, then move it manually.
packages/cli prepare$ modern build
packages/event prepare$ modern build
packages/model prepare$ modern build
packages/finger-print prepare$ modern build
packages/storage prepare$ modern build
packages/cli prepare:   Modern.js Module v2.41.0
packages/event prepare:   Modern.js Module v2.41.0
packages/model prepare:   Modern.js Module v2.41.0
packages/storage prepare:   Modern.js Module v2.41.0
packages/finger-print prepare:   Modern.js Module v2.41.0
packages/cli prepare: error   ModuleBuildError: 
packages/cli prepare: ╭───────────────────────╮
packages/cli prepare: │ bundleless failed:    │
packages/cli prepare: │  - format is "cjs"    │
packages/cli prepare: │  - target is "es2018" │
packages/cli prepare: ╰───────────────────────╯
packages/cli prepare: Detailed Information: 
packages/cli prepare: Error: Cannot find module '@ast-grep/napi-linux-x64-musl'
packages/cli prepare: Require stack:
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@ast-grep/napi/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/feature/redirect.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/feature/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/esbuild/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/build.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/build.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/command.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/cli.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/packages/cli/node_modules/.cache/bundle-require/modern.config.lPjSxpVD.cjs
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/node-bundle-require/dist/cjs/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/loadConfig.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/createLoadedConfig.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/createCli.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/index.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/runBin.js
packages/cli prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/bin/modern.js
packages/cli prepare:     at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
packages/cli prepare:     at Module._load (node:internal/modules/cjs/loader:985:27)
packages/cli prepare:     at Module.require (node:internal/modules/cjs/loader:1235:19)
packages/cli prepare:     at require (node:internal/modules/helpers:176:18)
packages/cli prepare:     at Object.<anonymous> (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@ast-grep/napi/index.js:177:31)
packages/cli prepare:     at Module._compile (node:internal/modules/cjs/loader:1376:14)
packages/cli prepare:     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
packages/cli prepare:     at Module.load (node:internal/modules/cjs/loader:1207:32)
packages/cli prepare:     at Module._load (node:internal/modules/cjs/loader:1023:12)
packages/cli prepare:     at Module.require (node:internal/modules/cjs/loader:1235:19)
packages/cli prepare:     at Object.run (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/index.js:78:15)
packages/cli prepare:     at async build (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/build.js:56:3)
packages/cli prepare:     at async Command.<anonymous> (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/command.js:52:5)
packages/cli prepare: Failed
 ELIFECYCLE  Command failed with exit code 1.
packages/finger-print prepare: error   ModuleBuildError: 
packages/finger-print prepare: ╭───────────────────────╮
packages/finger-print prepare: │ bundleless failed:    │
packages/finger-print prepare: │  - format is "cjs"    │
packages/finger-print prepare: │  - target is "es2018" │
packages/finger-print prepare: ╰───────────────────────╯
packages/finger-print prepare: Detailed Information: 
packages/finger-print prepare: Error: Cannot find module '@ast-grep/napi-linux-x64-musl'
packages/finger-print prepare: Require stack:
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@ast-grep/napi/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/feature/redirect.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/feature/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/esbuild/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/build.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/build.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/command.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/cli.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/packages/finger-print/node_modules/.cache/bundle-require/modern.config.fudXfuW5.cjs
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/node-bundle-require/dist/cjs/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/loadConfig.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/createLoadedConfig.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/createCli.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/index.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/runBin.js
packages/finger-print prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/bin/modern.js
packages/finger-print prepare:     at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
packages/finger-print prepare:     at Module._load (node:internal/modules/cjs/loader:985:27)
packages/finger-print prepare:     at Module.require (node:internal/modules/cjs/loader:1235:19)
packages/finger-print prepare:     at require (node:internal/modules/helpers:176:18)
packages/finger-print prepare:     at Object.<anonymous> (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@ast-grep/napi/index.js:177:31)
packages/finger-print prepare:     at Module._compile (node:internal/modules/cjs/loader:1376:14)
packages/finger-print prepare:     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
packages/finger-print prepare:     at Module.load (node:internal/modules/cjs/loader:1207:32)
packages/finger-print prepare:     at Module._load (node:internal/modules/cjs/loader:1023:12)
packages/finger-print prepare:     at Module.require (node:internal/modules/cjs/loader:1235:19)
packages/finger-print prepare:     at Object.run (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/index.js:78:15)
packages/finger-print prepare:     at async build (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/build.js:56:3)
packages/finger-print prepare:     at async Command.<anonymous> (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/command.js:52:5)
packages/event prepare: error   ModuleBuildError: 
packages/event prepare: ╭───────────────────────╮
packages/event prepare: │ bundleless failed:    │
packages/event prepare: │  - format is "cjs"    │
packages/event prepare: │  - target is "es2018" │
packages/event prepare: ╰───────────────────────╯
packages/event prepare: Detailed Information: 
packages/event prepare: Error: Cannot find module '@ast-grep/napi-linux-x64-musl'
packages/event prepare: Require stack:
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@ast-grep/napi/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/feature/redirect.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/feature/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/esbuild/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/build.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/build.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/command.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/cli.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/packages/event/node_modules/.cache/bundle-require/modern.config.4Tn1NSiI.cjs
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/node-bundle-require/dist/cjs/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/loadConfig.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/createLoadedConfig.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/config/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/createCli.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/index.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@modern-js/core/dist/runBin.js
packages/event prepare: - /builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/bin/modern.js
packages/event prepare:     at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
packages/event prepare:     at Module._load (node:internal/modules/cjs/loader:985:27)
packages/event prepare:     at Module.require (node:internal/modules/cjs/loader:1235:19)
packages/event prepare:     at require (node:internal/modules/helpers:176:18)
packages/event prepare:     at Object.<anonymous> (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected]/node_modules/@ast-grep/napi/index.js:177:31)
packages/event prepare:     at Module._compile (node:internal/modules/cjs/loader:1376:14)
packages/event prepare:     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
packages/event prepare:     at Module.load (node:internal/modules/cjs/loader:1207:32)
packages/event prepare:     at Module._load (node:internal/modules/cjs/loader:1023:12)
packages/event prepare:     at Module.require (node:internal/modules/cjs/loader:1235:19)
packages/event prepare:     at Object.run (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/builder/index.js:78:15)
packages/event prepare:     at async build (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/build.js:56:3)
packages/event prepare:     at async Command.<anonymous> (/builds/imean/frontend/imean-modules/node_modules/.pnpm/@[email protected][email protected]/node_modules/@modern-js/module-tools/dist/command.js:52:5)

I notice text that Error: Cannot find module '@ast-grep/napi-linux-x64-musl', then I try to install this module, but I got @ast-grep/napi-linux-x64-musl is not in the npm registry, or you have no permission to fetch it.. therefore I go to @ast-grep/ast-grep 's GitHub repository, and I find @ast-grep not includes the module. I need help, please response me. thanks

复现链接

https://github.com/losgif/modern-js-example

复现步骤

1、Docker build

docker build ./ -t test

2、Docker run

docker run -d --name test test

3、Check logs
image

@linaaaqi linaaaqi added the bug Something isn't working label Dec 25, 2023
@nullptru
Copy link

Have you solved this problem? I have encountered the same issue.

@10Derozan
Copy link
Contributor

I am sorry to see the error. I will try to support it for ast-grep

@10Derozan
Copy link
Contributor

Try to overrides ast-grep/ast-grep#944 (comment), I will update it in next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants