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

wepy new x新建项目出错 #15

Closed
tao2581 opened this issue Jan 10, 2017 · 1 comment
Closed

wepy new x新建项目出错 #15

tao2581 opened this issue Jan 10, 2017 · 1 comment

Comments

@tao2581
Copy link

tao2581 commented Jan 10, 2017

image

[18:58:28] [完成] 安装依赖完成
[18:58:28] [执行] 执行命令: wepy build
[18:58:28] [信息] 可能需要几分钟, 请耐心等待...
/Users/tds/webroot/weapp/Weapp/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:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.getConfig (/usr/local/lib/node_modules/wepy-cli/lib/util.js:294:22)
    at Object.build (/usr/local/lib/node_modules/wepy-cli/lib/compile.js:177:37)
    at Command.<anonymous> (/usr/local/lib/node_modules/wepy-cli/lib/wepy.js:162:23)
[18:58:30] [错误] 代码编译出错

image

改成 var prod = process.env.NODE_ENV === 'production';
继续 build 成功

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 10, 2017

'use strict'; 或者改成var都可以,但是建议升级一下NodeJS版本
参考: #2

@Gcaufy Gcaufy closed this as completed Jan 10, 2017
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

2 participants