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

最新3.5.5版本 加了set NODE_ENV=production 后启动失败 #12509

Closed
BG7ZAG opened this issue Sep 18, 2022 · 7 comments
Closed

最新3.5.5版本 加了set NODE_ENV=production 后启动失败 #12509

BG7ZAG opened this issue Sep 18, 2022 · 7 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@BG7ZAG
Copy link

BG7ZAG commented Sep 18, 2022

相关平台

微信小程序

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

复现步骤

使用taro init myApp初始化,选择React,sass,ts,默认模板,GitHub源模板,
在package.json中添加一行:
"dev:weapp:build": "set NODE_ENV=production && taro build --type weapp --watch",

期望结果

期望能正常启动

实际结果

 ELIFECYCLE  Command failed with exit code 1.
image

环境信息

 Taro CLI 3.5.5 environment info:
    System:
      OS: Windows 11
    Binaries:
      Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
      npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Sep 18, 2022
@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 19, 2022

@hlbj105 有试过 3.5.4 可以么?

@BG7ZAG
Copy link
Author

BG7ZAG commented Sep 19, 2022

@hlbj105 有试过 3.5.4 可以么?

刚才试了下,还是这样

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 19, 2022

我这边 Mac 试了没问题,或者你可以提供一下完整 demo

@BG7ZAG
Copy link
Author

BG7ZAG commented Sep 19, 2022

我这边 Mac 试了没问题,或者你可以提供一下完整 demo

Demo https://github.com/hlbj105/taro-error-demo
我觉得可能是win下才有的问题

@BG7ZAG
Copy link
Author

BG7ZAG commented Sep 19, 2022

我这边 Mac 试了没问题,或者你可以提供一下完整 demo

还真是windows的问题,刚才在wsl里试了下,能正常跑,Linux下是没问题的(Linux下使用的环境变量设置是:NODE_ENV=production taro build --type weapp --watch

@TheKonka
Copy link
Member

taro build --type weapp --watch --env production
这样可以吗

@BG7ZAG
Copy link
Author

BG7ZAG commented Sep 20, 2022

这样可以,谢谢 @TheKonka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

3 participants