bash - Vue init webpack 测试 - 未创建项目 - 严格模式错误?

标签 bash webpack vue.js

我尝试使用创建一个项目

$ vue init webpack test

并出现以下错误

/usr/local/lib/node_modules/vue-cli/bin/vue-init:60 let template = program.args[0] ^ 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:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3

不幸的是,没有创建“test”目录。

我在 Windows 10 上的 Ubuntu 上使用 Bash 以及以下 NPM 软件包:

最佳答案

可能是node版本太低了。 使用

npm install -g n 
sudo n stable  
sudo npm install npm -g
更新您的节点版本

当你node -v 发现没有变化,但尝试再次初始化vue项目。

关于bash - Vue init webpack 测试 - 未创建项目 - 严格模式错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47012314/

相关文章:

linux - 定期列出文件的 Bash 脚本

node.js - Webpack 用于后端?

css - 使用 VueJs2 和 webpack 的传单 CSS 导入问题

javascript - 使用 JS 和 VueJS 将 HTML 内容减少到 20 个单词?

bash - Wakanda 服务器脚本干净关闭

linux - 如何用文件中的绝对路径替换变量值?

javascript - [Vue 警告] : inject() can only be used inside setup() or functional components

vue.js - 使用 v-for 和 v-show 隐藏/显示 p 元素内的附加文本

bash 从 fcntl 锁定文件中排除循环

javascript - HistoryApiFallback 不适用于 Webpack 4(使用 React Router 4 和嵌套路由)