iku*_*teu 4 npm monorepo pnpm rush
我的团队正在迁移到 rush,我在设置时遇到了问题:当尝试使用(例如)将任何第 3 方库(比方说react)添加到 package.json时,我遇到了一个奇怪的错误。rush add --package react错误日志:
Found configuration in /home/ivan/dev/JS/eisbuk/rush.json
Rush Multi-Project Build Tool 5.66.2 - https://rushjs.io
Node.js version is 14.19.0 (LTS)
Found configuration in /home/ivan/dev/JS/eisbuk/rush.json
Starting "rush add"
Determining new version for dependency: react
No version selector was specified, so the version will be determined automatically.
Trying to acquire lock for pnpm-6.32.3
Acquired lock for pnpm-6.32.3
Found pnpm version 6.32.3 in /home/ivan/.rush/node-v14.19.0/pnpm-6.32.3
Symlinking "/home/ivan/dev/JS/eisbuk/common/temp/pnpm-local" --> "/home/ivan/.rush/node-v14.19.0/pnpm-6.32.3"
The "ensureConsistentVersions" policy is NOT active, so we will assign the latest version.
Querying NPM registry for latest version of "react"...
ERROR: The command failed with exit code 243
Run Code Online (Sandbox Code Playgroud)
我试图找到与rush相关的类似问题报告,并使用npm查找243错误,均无济于事。我正在使用pnpm,但是,npm和yarn的错误仍然存在(使用yarn exit code 1,其他一切都相同)。
这是我的 .npmrc (实际上是默认的):
registry=https://registry.npmjs.org/
always-auth=false
Run Code Online (Sandbox Code Playgroud)
有趣的是,如果我手动将依赖项添加到 package.json 并运行rush update,更新会顺利进行,并且 dep 会添加到 node_modules 和 Shrinkwrap (所以它不应该是 npm 注册表问题)。这是我的 rush.json:
registry=https://registry.npmjs.org/
always-auth=false
Run Code Online (Sandbox Code Playgroud)
整个存储库可以在以下位置找到:https ://github.com/eisbuk/EisBuk/tree/feature/rush
解决了!
最后,我成功地将其定位到节点版本。我使用的是 v14.19.0 并升级到 v16.14.2 解决了这个问题。我不知道这是否是已知的不兼容性,但确实如此。
| 归档时间: |
|
| 查看次数: |
14015 次 |
| 最近记录: |