npm install vue --save
Stuff gets installed and stored in package.json and package-lock.json, including:
"vue": "^2.5.21",
"vue-router": "^3.0.2",
"vue-server-renderer": "^2.5.21",
But when I run
node src/main.js
with sourcecode (this is the full main.js file, 1 line)
import Vue from 'vue';
I get the error
src/main.js:1
(function (exports, require, module, __filename, __dirname) { import Vue from 'vue'
^^^
SyntaxError: Unexpected identifier
The import line is used in many Hello worlds, something simple must be wrong. Node version is v10.15.0. For example https://v2.vuejs.org/v2/guide/components-registration.html
main.jsfile.nodeversion?const Vue = require('vue');instead.