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

build 报错 #2

Closed
JZLeung opened this issue Dec 5, 2016 · 10 comments
Closed

build 报错 #2

JZLeung opened this issue Dec 5, 2016 · 10 comments

Comments

@JZLeung
Copy link

JZLeung commented Dec 5, 2016

新建的项目,直接build的时候就报错了。

/Volumes/Data/Leung/Workspace/cnode/wepy.config.js:2
let prod = process.env.NODE_ENV === 'production';
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.getConfig (/usr/local/lib/node_modules/wepy-cli/lib/util.js:225:22)
    at Object.build (/usr/local/lib/node_modules/wepy-cli/lib/compile.js:156:37)
    at Command.<anonymous> (/usr/local/lib/node_modules/wepy-cli/lib/wepy.js:130:23)
@Gcaufy
Copy link
Collaborator

Gcaufy commented Dec 6, 2016

好久没升级NODE版本了吧,升级一下新的node,应该是node版本问题。

node -v 看看。

@JZLeung
Copy link
Author

JZLeung commented Dec 6, 2016

好的,我晚上回去看看。

@AlbertLiu-Breeze
Copy link

我的node版本是 4.4.3,依然不行,必须手动修改代码才能编译成功

@kiner-tang
Copy link

image

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 13, 2017

@AlbertLiu-Breeze @kiner-tang node 5+, npm 3+

@kiner-tang
Copy link

我的可以了,真的是node版本太旧了

@wangmengHB
Copy link

我的node版本是8.9.4, 我也出现同样的问题,polyfill完全引入不进去,Promise,process等等undefined,场景是新建一个standard项目

@Gcaufy
Copy link
Collaborator

Gcaufy commented Feb 23, 2018

@wangmengHB npm 的版本呢?
不会用到process的。。看看是哪里出了问题。

@YZFYZF
Copy link

YZFYZF commented Mar 9, 2018

我的node也是8以上 也是不行的 有解决的吗

@cdll
Copy link

cdll commented Mar 26, 2018

y not use node@LTS?

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

7 participants