npm run dev 报错!SyntaxError: Use of const in strict mode.

  1. 云栖社区>
  2. 博客>
  3. 正文

npm run dev 报错!SyntaxError: Use of const in strict mode.

论尽先生 2019-03-17 20:24:23 浏览335 评论0

摘要: D:initUser20190315renren-fast-vue-masternode_moduleswebpack-dev-serveebpack-dev-server.js:8const fs = require('fs');^^^^^SyntaxError: Use of const in strict mode.

D:initUser20190315renren-fast-vue-masternode_moduleswebpack-dev-serve
ebpack-dev-server.js:8
const fs = require('fs');
^^^^^
SyntaxError: Use of const in strict mode.

at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\nodejs\\node.exe" "C:\Program
x86)\nodejs\node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! renren-fast-vue@1.2.2 dev: `webpack-dev-server --inline --progre
nfig build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the renren-fast-vue@1.2.2 dev script 'webpack-dev-serv

原因:node.js版本过低,升级到项目支持的版本。

【云栖快讯】阿里巴巴小程序繁星计划,20亿补贴第一弹云应用立即开通购买,限量从速!  详情请点击

网友评论