[英]const os = require('os') SyntaxError: Use of const in strict mode
While building application with Teamcity 9.1.7 we are getting below error - 在使用Teamcity 9.1.7构建应用程序时,我们遇到了以下错误-
const os = require('os'); const os = require('os'); ^^^^^ ^^^^^
Loading "Gruntfile.js" tasks...ERROR 正在加载“ Gruntfile.js”任务...错误
SyntaxError: Use of const in strict mode. SyntaxError:在严格模式下使用const。
Any help is greatly appriciated 任何帮助都非常有用
add 'use strict';
添加'use strict';
to the top of the file. 到文件顶部。 Or better update your node.js 或者更好地更新您的node.js
'use strict';
const os = require('os');
// rest of the file
For your version of node (6.11.3 as you've mentioned in comment) everything should works fine. 对于您的节点版本(如您在注释中提到的6.11.3),一切正常。 I've just checked 我刚检查
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.