[Support] 安装报错
#4598
Replies: 10 comments
|
看报错是脚手架读取模板包的 可以先清一下本地 npx/npm 缓存后重试,或者显式使用官方 registry: npm cache verify
npm init midway@latest -- --registry=https://registry.npmjs.org/如果仍然出现 npm config get registry
npm view @midwayjs-examples/application-koa-esm-v4 dist-tags --json |
0 replies
|
试了清缓存 还是一样的错误。
PS D:\midway> npm config get registry
https://registry.npmjs.org/
PS D:\midway> npm view @midwayjs-examples/application-koa-esm-v4 dist-tags --json
[
{
"latest": "1.0.4"
}
]
|
0 replies
|
你的 registry 是哪个?https://www.npmjs.com/package/@midwayjs-examples/application-koa-esm-v4?activeTab=versions |
0 replies
|
就是官方源 没有换 看下是不是npm12不兼容的问题呢?因为之前是好的 更新npm12后出问题了
|
0 replies
0 replies
|
npm 版本,这个倒是有可能。 |
0 replies
|
麻烦解决一下吧
|
0 replies
0 replies
|
在新版本试试,npm 12 的问题应该已经解决了 |
0 replies
|
我已经试过了 可以了 谢谢大佬
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Describe the problem(描述问题)
npm init midway@latest
npm notice run npx
npm notice run create-midway
√ Hello, traveller.
Which template do you like? · react-functional-v4 - A functional web application boilerplate with midway v4(react)
√ What name would you like to use for the new project? · midway-project
Downloading Boilerplate... [Generator]: "npm pack @midwayjs-examples/application-react-functional-v4@undefined && mkdir midwayjs-examples-application-react-functional-v4-undefined" download template failed and try with npm
Error: Command failed: npm pack @midwayjs-examples/application-react-functional-v4@undefined && mkdir midwayjs-examples-application-react-functional-v4-undefined
npm error code ETARGET
npm error notarget No matching version found for @midwayjs-examples/application-react-functional-v4@undefined.
npm error notarget In most cases you or one of your dependencies are requesting a package version that doesn't exist.
npm error A complete log of this run can be found in: C:\Users\zzzff\AppData\Local\npm-cache_logs\2026-07-25T20_07_42_943Z-debug-0.log
at genericNodeError (node:internal/errors:985:15)
at wrappedFn (node:internal/errors:539:14)
at checkExecSyncError (node:child_process:925:11)
at Object.execSync (node:child_process:997:15)
at NpmPatternGenerator.getPackage (C:\Users\zzzff\AppData\Local\npm-cache_npx\7ea2f2c8fa89e105\node_modules\create-midway\dist\index.js:12192:33)
at NpmPatternGenerator.getTemplateConfig (C:\Users\zzzff\AppData\Local\npm-cache_npx\7ea2f2c8fa89e105\node_modules\create-midway\dist\index.js:12232:20)
at NpmPatternGenerator.run (C:\Users\zzzff\AppData\Local\npm-cache_npx\7ea2f2c8fa89e105\node_modules\create-midway\dist\index.js:12010:42)
at async AddPlugin.generator (C:\Users\zzzff\AppData\Local\npm-cache_npx\7ea2f2c8fa89e105\node_modules\create-midway\dist\index.js:20055:7)
at async AddPlugin.run (C:\Users\zzzff\AppData\Local\npm-cache_npx\7ea2f2c8fa89e105\node_modules\create-midway\dist\index.js:19963:5) {
status: 1,
signal: null,
output: [
null,
null,
<Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 54 41 52 47 45 54 0a 6e 70 6d 20 65 72 72 6f 72 20 6e 6f 74 61 72 67 65 74 20 4e 6f 20 6d 61 74 63 68 ... 338 more bytes>
],
pid: 28756,
stdout: null,
stderr: <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 54 41 52 47 45 54 0a 6e 70 6d 20 65 72 72 6f 72 20 6e 6f 74 61 72 67 65 74 20 4e 6f 20 6d 61 74 63 68 ... 338 more bytes>
}
PS D:\midway> npm init midway
npm notice run npx
npm notice run create-midway
√ Hello, traveller.
Which template do you like? · koa-v4-esm - A web application boilerplate with midway v4(koa), now in beta
√ What name would you like to use for the new project? · midway-project
√ The name 'midway-project' already exists, can it be overwritten? (Y/n) · true
Downloading Boilerplate... [Generator]: "npm pack @midwayjs-examples/application-koa-esm-v4@undefined && mkdir midwayjs-examples-application-koa-esm-v4-undefined" download template failed and try with npm
Error: Command failed: npm pack @midwayjs-examples/application-koa-esm-v4@undefined && mkdir midwayjs-examples-application-koa-esm-v4-undefined
npm error code ETARGET
npm error notarget No matching version found for @midwayjs-examples/application-koa-esm-v4@undefined.
npm error notarget In most cases you or one of your dependencies are requesting a package version that doesn't exist.
npm error A complete log of this run can be found in: C:\Users\zzzff\AppData\Local\npm-cache_logs\2026-07-25T20_15_09_068Z-debug-0.log
at genericNodeError (node:internal/errors:985:15)
at wrappedFn (node:internal/errors:539:14)
at checkExecSyncError (node:child_process:925:11)
at Object.execSync (node:child_process:997:15)
at NpmPatternGenerator.getPackage (C:\Users\zzzff\AppData\Local\npm-cache_npx\a183fac6a7de8929\node_modules\create-midway\dist\index.js:12172:33)
at NpmPatternGenerator.getTemplateConfig (C:\Users\zzzff\AppData\Local\npm-cache_npx\a183fac6a7de8929\node_modules\create-midway\dist\index.js:12212:20)
at NpmPatternGenerator.run (C:\Users\zzzff\AppData\Local\npm-cache_npx\a183fac6a7de8929\node_modules\create-midway\dist\index.js:11990:42)
at async AddPlugin.generator (C:\Users\zzzff\AppData\Local\npm-cache_npx\a183fac6a7de8929\node_modules\create-midway\dist\index.js:20035:7)
at async AddPlugin.run (C:\Users\zzzff\AppData\Local\npm-cache_npx\a183fac6a7de8929\node_modules\create-midway\dist\index.js:19943:5) {
status: 1,
signal: null,
output: [
null,
null,
<Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 54 41 52 47 45 54 0a 6e 70 6d 20 65 72 72 6f 72 20 6e 6f 74 61 72 67 65 74 20 4e 6f 20 6d 61 74 63 68 ... 329 more bytes>
],
pid: 24480,
stdout: null,
stderr: <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 54 41 52 47 45 54 0a 6e 70 6d 20 65 72 72 6f 72 20 6e 6f 74 61 72 67 65 74 20 4e 6f 20 6d 61 74 63 68 ... 329 more bytes>
}
Midway Versions(Midway 版本)
node 24.18.0
npm 12.0.1
All reactions