0
Preferred I would like to thank this project, but I am not sure what went wrong involving Lerna NPM Execa

1. The project structure looks something like this
/Users/xxxx/project-root-dir
├─┬ packages
│ ├─┬ a-test
│ │ └── package.json # scripts: { pub: "s-lerna beta" }
│ ├── s-lerna
│ ├── src/bin/index.js
│ ├── package.json # dependencies: { "execa": "^5.0.0", "lerna": "^4.0.0" }
2. Execute NPM link in S-LERNA
3. Execute NPM link S-Lerna under A-test
4. Running NPM run pub under a-test is equivalent to NPX s-lerna beta
5. Expected Behaviors:
S-Lerna for internal use
await execa(`lerna version prerelease --preid beta --yes`, [], { shell: true, preferLocal: true })
Be able to function
6. The reality is that:
/bin/sh: lerna: command not found


7. Some try a-test directories that look like this
├─┬ a-test
│ ├─┬ node_modules
│ │ └── .bin
│ │ └── single-lerna # 软连接
│ │ │   └── node_modules
│ │ │   │   └── lerna


现在我大概明白为什么找不到EXECA了,是这个级别的问题造成的。我想知道有哪些低成本和标准的方法可以解决问题并达到预期。

虽然可以先在A-test中运行npm -i lerna --no-save && npm link s-lerna,但是我的项目很多,不能在每个目录下都运行太麻烦了!

可能是一个很好的解决方案 PNPM?(我没试过)

4

0 回答 0