Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对于 lerna 产生的快捷方式文件夹扫描任然报错 #4538

Closed
tangbc opened this issue Sep 25, 2019 · 4 comments
Closed

对于 lerna 产生的快捷方式文件夹扫描任然报错 #4538

tangbc opened this issue Sep 25, 2019 · 4 comments
Assignees

Comments

@tangbc
Copy link

tangbc commented Sep 25, 2019

问题描述

当 taro 和 lerna 结合使用时对于 lerna 产生的快捷方式文件夹扫描任然报错。

之前提了个 issue #4431 ,发现昨天 1.3.19 已经更新了,试了下,还是扫描出错,所以上传了个复现 demo

复现步骤:

先全局安装 tarolerna

然后:

git clone https://github.com/tangbc/taro-lerna-demo

cd taro-lerna-demo/

npm install

lerna bootstrap // lerna 包建立连接关系

npm run dev:h5

报错信息:

 Taro v1.3.19

开始编译项目 lerna-tets
创建  发现文件  src/.DS_Store
创建  发现文件  src/app.less
创建  发现文件  src/app.tsx
创建  发现文件  src/index.html
创建  发现文件  src/packages/.DS_Store
创建  发现文件  src/pages/package.json
创建  发现文件  src/packages/utils/index.ts
创建  发现文件  src/packages/utils/package.json
创建  发现文件  src/pages/index/index.less
创建  发现文件  src/pages/index/index.tsx
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, lstat '/Users/mymac/github/packages/utils'
Emitted 'error' event at:
    at /usr/local/lib/node_modules/@tarojs/cli/node_modules/klaw/src/index.js:28:26
    at callback (/usr/local/lib/node_modules/@tarojs/cli/node_modules/graceful-fs/polyfills.js:295:20)
    at FSReqWrap.oncomplete (fs.js:153:21)
npm ERR! code ELIFECYCLE

原因猜测

因该是扫描文件夹快捷方式时的源路径寻找错误:lstat '/Users/mymac/github/packages/utils'

@taro-bot
Copy link

taro-bot bot commented Sep 25, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@taro-bot
Copy link

taro-bot bot commented Oct 8, 2019

CC @luckyadam

@luckyadam
Copy link
Member

luckyadam commented Oct 12, 2019

hello~ 抱歉,由于之前很忙,这个问题一直没来得及看,我看了你的仓库,发现是一个 Taro 项目里包含了 lerna 包管理,这种方式目前暂时不支持,而且调整起来有些麻烦,目前可以支持在 Taro 项目之外使用 lerna 来管理,结构如下

├── packages           
|   ├── taroproj   
|   └── util          
└── lerna.json

@tangbc
Copy link
Author

tangbc commented Oct 14, 2019

好的,如果后期这个支持了麻烦在这个 issue 注明下,我们好更新到这种形式。

试了下如果这样组织也是报错的:

├── packages           
|   ├── taroproj   
|   └── util          
└── lerna.json

Taro 编译 src 选择 taroproj 目录后,始终无法通过快捷方式引用 util 文件夹下的文件。

@Chen-jj Chen-jj closed this as completed Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants