-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(cli): 修复没有全局安装 @tarojs/cli 依赖的时候执行 npm run XXX 报错 #2226
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docs: update component.md close#1750
* 使用findDOMNode 做优化,兼容React
将 TaroUtilss 修改成 TaroUtils
cli 在模板里还是不加入到项目的依赖里,让用户自己去选择是否加入,之前有加入过,但是会和全局安装的 cli 发生冲突导致问题不好排查,所以去掉了 |
嗯,这是一个问题,本地版本和全局版本对有些用户来说确实容易混淆,但是看现在包管理的方式绝大都是项目依赖,我看文档 |
@shaodahong 这样子,我们思考一下,文档同时也要更新一下了 |
好的 |
我也遇到同样问题,在使用npx taro build --type h5 --watch时出现command not found: taro问题,请问这个该怎么解决? @luckyadam |
@xiaohaoo 自己加一下 yarn add -D @tarojs/cli
yarn taro build --type h5 --watch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
使用
npx @tarojs/cli init myApp
初始化项目后,进入到项目文件夹执行yarn dev:alipay
, 提示sh: taro: command not found
因为我没有全局安装
cli
, 所以在package.json
中增加@tarojs/cli
依赖,这样会使用当前项目中的@tarojs/cli
我看了下对
taro update
也没有影响,不知道有没有其他疏忽的,麻烦看下 @luckyadam