vux执行npm run dev 的时候报错 not yet sup ported outside strict mode?

在执行npm run dev 时报严格模式的错误,如果去掉文件里面的'strict'标签就可以,但是要改的文件太多了,肯定不是这么解决,各位大神帮我看看。谢谢

D:\work\nodejsspace\mmrun>npm run dev

mmrun@1.0.0 dev D:\work\nodejsspace\mmrun
node build/dev-server.js

▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
D:\work\nodejsspace\mmrun\build\webpack.base.conf.js:14
let webpackConfig = {
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet sup
ported 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.<anonymous> (D:\work\nodejsspace\mmrun\build\webpack.dev.conf.js:5

:25)

at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\Program Files\nodejs\node.exe" "C:\Users\gu\AppData\Roa
ming\npm\node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v4.5.0
npm ERR! npm v3.0.0
npm ERR! code ELIFECYCLE
npm ERR! mmrun@1.0.0 dev: node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmrun@1.0.0 dev script 'node build/dev-server.js'.
npm ERR! This is most likely a problem with the mmrun package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/dev-server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls mmrun
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:\work\nodejsspace\mmrun\npm-debug.log

阅读 5.5k
5 个回答

配置文件中使用了 ES6 语法,升级你的 NodeJs 版本到 6.x 以上即可解决。

我也是报这个错~~~window系统,好难弄啊。。

啊能贴下你的部分代码?最好大块些?

dev-server.js 就是检查node和npm版本的工具,应该确实就是版本的问题

将node升级到最新版本 应该是 6.9.5
或者在webpack中不要使用es6语法。
4.x对es6的支持需要开启harmony或者在文件头部加上use strict

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题