我使用 turborepo 创建了一个 repo,并具有以下文件夹结构
API 目录包含环回 API。
如果我yarn lint
从项目级别运行,则会引发此错误
api:lint: $ lb-eslint --report-unused-disable-directives .
api:lint: node:internal/modules/cjs/loader:488
api:lint: throw e;
api:lint: ^
api:lint:
api:lint: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './bin/eslint' is not defined by "exports" in ....Project0/node_modules/eslint/package.json
api:lint: at new NodeError (node:internal/errors:371:5)
api:lint: at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
api:lint: at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
api:lint: at resolveExports (node:internal/modules/cjs/loader:482:36)
api:lint: at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
api:lint: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
api:lint: at Function.resolve (node:internal/modules/cjs/helpers:108:19)
api:lint: at resolveCLI (....Project0/node_modules/@loopback/build/bin/utils.js:76:18)
api:lint: at Object.runCLI (....Project0/node_modules/@loopback/build/bin/utils.js:128:9)
api:lint: at run (..../node_modules/@loopback/build/bin/run-eslint.js:45:16) {
api:lint: code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
api:lint: }
如果我从 API 目录中运行相同的命令,则会出现同样的问题。帮助!