ajv-validator / ajv-validator/ajv-cli

build fails in "npm i" - tsc errors: 'err' is of type 'unknown'.

未关闭
#245 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
316
派生
77
PR 合并指标
30 天内没有已合并 PR

描述

I cloned this repo and tried to build locally (to try to debug/fix an issue I reported).

The `npm i` command failed in `tsc`

```text
$ npm i

> ajv-cli@5.0.0 prepublish
> npm run build

> ajv-cli@5.0.0 build
> rimraf dist && tsc

src/commands/ajv.ts:89:11 - error TS18046: 'err' is of type 'unknown'.

89 if (err.code === "MODULE_NOT_FOUND") {
~~~

src/commands/ajv.ts:91:110 - error TS18046: 'err' is of type 'unknown'.

91 `'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${err.message}`
~~~

src/commands/util.ts:55:25 - error TS18046: 'err' is of type 'unknown'.

55 const msg: string = err.message
~~~

src/commands/util.ts:85:29 - error TS18046: 'err' is of type 'unknown'.

85 console.error(`error: ${err.message}`)
~~~

Found 4 errors in 2 files.

Errors Files
2 src/commands/ajv.ts:89
2 src/commands/util.ts:55
npm ERR! code 2
npm ERR! path ~/dev/tools/ajv-cli
npm ERR! command failed
npm ERR! command sh -c npm run build
```

Opening the project in VSCode, I also see (other) errors such as

```
Cannot find module 'json5'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? ts(2792)
```

What version of Node.js is required to build? I tried Node 18 and 20

Please add a `CONTRIBUTING` file or build instructions to the `README` since this project does not build "out of the box".

(i.e. should I increment the `package.json` version when submitting a PR, or do maintainers do that when making a release, etc.)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。