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

taro 3.6.35 执行taro init报错 Error: Cannot find module '@swc/types' #16896

Open
EthanZhuGit opened this issue Nov 21, 2024 · 4 comments
Open

Comments

@EthanZhuGit
Copy link

EthanZhuGit commented Nov 21, 2024

相关平台

微信小程序

小程序基础库: 1
使用框架: React

复现步骤

npm install -g @tarojs/cli@3.6.35
taro init myApp

期望结果

执行taro命令不报错

实际结果

node:internal/modules/cjs/loader:1143
throw err;
^

Error: Cannot find module '@swc/types'
Require stack:

环境信息

这是网上找的,执行taro info也报错
我的环境是Windows11 x64
node 18.20.4
npm  10.7.0



$ taro info
👽 Taro v3.0.7



  Taro CLI 3.0.7 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 13.14.0 - ~/.nvm/versions/node/v13.14.0/bin/node
      Yarn: 1.22.4 - ~/.nvm/versions/node/v13.14.0/bin/yarn
      npm: 6.14.4 - ~/.nvm/versions/node/v13.14.0/bin/npm
    npmPackages:
      @tarojs/components: 1.3.27 => 1.3.27
      @tarojs/router: 1.3.27 => 1.3.27
      @tarojs/taro: 1.3.27 => 1.3.27
      @tarojs/taro-h5: 1.3.27 => 1.3.27
      @tarojs/webpack-runner: 1.3.27 => 1.3.27
      eslint-config-taro: 1.3.27 => 1.3.27
      eslint-plugin-taro: 1.3.27 => 1.3.27
      nerv-devtools: 1.5.5 => 1.5.5
      nervjs: 1.5.5 => 1.5.5

@Y-Good
Copy link

Y-Good commented Nov 21, 2024

暂时指定一下版本
image

@EthanZhuGit
Copy link
Author

暂时指定一下版本 image

请问在哪里指定,项目没有创建成功,什么也没有

@Y-Good
Copy link

Y-Good commented Nov 21, 2024

暂时指定一下版本 image

请问在哪里指定,项目没有创建成功,什么也没有

我的Taro版本是4.0.7,能创建项目

@rhinoceros-stand
Copy link

目前找到一个办法,先把 taro-project-templates 拉取回来,然后安装项目依赖,安装 @swc/types 模块。
再使用 taro init 新建项目...

This was referenced Nov 23, 2024
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