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

@tarojs/cli创建和启动项目报错 #12676

Closed
WalkerChan2019 opened this issue Oct 18, 2022 · 18 comments
Closed

@tarojs/cli创建和启动项目报错 #12676

WalkerChan2019 opened this issue Oct 18, 2022 · 18 comments
Assignees
Labels
A-cli Area - CLI 相关 V-3 Version - 3.x

Comments

@WalkerChan2019
Copy link

我使用@tarojs/cli创建和启动项目遇到令我十分困惑的问题:

  1. v1.3.9时,提示“× 拉取远程模板仓库失败!”
    QQ截图20221018172640
  2. 最新版本v3.5.6时,报:@tarojs\service\dist\utils\index.js:75 throw new Error(插件依赖 "${item}" 加载失败,请检查插件配置);
    QQ截图20221018172731
  3. 启动公司项目,报错类似
    QQ截图20221018172953
@taro-bot2
Copy link

taro-bot2 bot commented Oct 18, 2022

您的 Issue 没有按照规范从 Taro Issue Helper 创建,因此会被直接关闭。

维护开源项目是一项非常辛苦的工作,还请多多包涵。
了解为什么这么严格?

1 similar comment
@taro-bot2
Copy link

taro-bot2 bot commented Oct 18, 2022

您的 Issue 没有按照规范从 Taro Issue Helper 创建,因此会被直接关闭。

维护开源项目是一项非常辛苦的工作,还请多多包涵。
了解为什么这么严格?

@taro-bot2 taro-bot2 bot closed this as completed Oct 18, 2022
@taro-bot2 taro-bot2 bot closed this as completed Oct 18, 2022
@Chen-jj Chen-jj reopened this Oct 18, 2022
@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 18, 2022

swc 1.3.9 存在问题

@weaeqqq
Copy link

weaeqqq commented Oct 19, 2022

要怎么解决,最新的taro版本3.5.6遇到 throw new Error(插件依赖 "${item}" 加载失败,请检查插件配置)

@justwe7
Copy link

justwe7 commented Oct 19, 2022

我把node升到18可以用3.5.6,或者低版本的用3.4.x也可以 #12171

@weaeqqq
Copy link

weaeqqq commented Oct 19, 2022

刚nvm试了node升级到v18.9.0还是会出现swc这个报错问题

@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 19, 2022

据反馈,应该是安装 @swc/core 时(与 swc 版本无关)没有安装对应系统的可执行文件导致。非必现。

猜测可能与各位的系统、Node 版本、包管理工具及其版本、registry、网络环境等相关。

因此需要各位提供以上信息再作分析。

目前找到最有可能的解析:npm/cli#4828 (comment)

@weaeqqq
Copy link

weaeqqq commented Oct 19, 2022

node升级后还是出现这个swc问题,将taro指定到3.4.x就没有这个问题了

@weaeqqq
Copy link

weaeqqq commented Oct 19, 2022

据反馈,应该是安装 @swc/core 时(与 swc 版本无关)没有安装对应系统的可执行文件导致。非必现。

猜测可能与各位的系统、Node 版本、包管理工具及其版本、registry、网络环境等相关。

因此需要各位提供以上信息再作分析。

这种问题怎么解决好点,看别人出现的也比较多

@1oo1
Copy link

1oo1 commented Oct 19, 2022

我也遇到了类似的问题,已解决。供遇到类似问题的朋友参考。

小程序旧项目,从 3.4.9 升级到 3.5.6 后编译出错,node 版本 12 和16 都试了,都报同样的错误。

排查过程:

1、排查异常堆栈信息,出错的地方在 swc,再往上看调用栈,有一行 at readConfig (/xxxx/xxx/xxx/node_modules/@tarojs/helper/src/utils.ts:659:37)

2、这是 source map 里的代码行数,比较幸运的是在 @tarojs/helper/dist/utils.js 里找到了 readConfig 方法,里面有 swcRegister 的调用,在方法第一行打印log:console.log('================ 可能有问题的文件', configPath);

3、执行 taro build,找到报错的代码文件,有问题的原代码比较简单,是page的配置文件:

const config = {
  allowsBounceVertical: 'NO',
  pullRefresh: 'false'
};

export default config;

4、随便对比了两个打印的正常编译的其他配置文件后,更改为下面形式后修复了 swc 的编译问题:

export default {
  allowsBounceVertical: 'NO',
  pullRefresh: 'false'
};

这里有个 issue,跟我遇到的是同一个问题 #12674

@roftLin
Copy link

roftLin commented Feb 2, 2023

Hey buddy, I have encountered the same issue as you and have solved it, I would like to share my experience with you to see if it can help.
Just a few days ago I was able to install Taro-cli without any issues, then after reinstalling the system, my project encountered the same error as yours. I searched for solutions in the Taro repository and the SWC repository, but there was no ready answer. However, they gave some directions to troubleshoot.
So I tried switching the node version, package manager version and source, and Taro/cli version, but all failed. Finally, I debugged the source code with breakpoints, combined with my own experience, and found that the problem was related to the rust runtime environment, which needed to be installed. The specific installation method can be referred to the link below.
https://blog.csdn.net/u011149152/article/details/123518465

@TheKonka
Copy link
Member

TheKonka commented Feb 10, 2023

今天把全局 taro版本切到1.3 又切到 3.6时遇到了,最后重新安装 @tarojs/cli 最新版本解决了
中间使用nvm调整过 node版本到 18.14.0
后续又作了一次taro版本切换,没有出现报错

@sharesTeam
Copy link

sharesTeam commented Feb 24, 2023

安装windows C++环境

@MagicHacker
Copy link

3.6.2版本遇到相同的问题

@sparkKenzo
Copy link

有效,安装Microsoft Visual C++就可以了

@D2073620106
Copy link

安装Microsoft Visual C++运行起来了,这个问题真恶心 ,下载地址:https://learn.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?view=msvc-170

@CinseYoung
Copy link

可以! 解决问题了

@rbmonster
Copy link

Hey buddy, I have encountered the same issue as you and have solved it, I would like to share my experience with you to see if it can help. Just a few days ago I was able to install Taro-cli without any issues, then after reinstalling the system, my project encountered the same error as yours. I searched for solutions in the Taro repository and the SWC repository, but there was no ready answer. However, they gave some directions to troubleshoot. So I tried switching the node version, package manager version and source, and Taro/cli version, but all failed. Finally, I debugged the source code with breakpoints, combined with my own experience, and found that the problem was related to the rust runtime environment, which needed to be installed. The specific installation method can be referred to the link below. https://blog.csdn.net/u011149152/article/details/123518465

Thanks bro. install rust environment solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI 相关 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests