Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable start project i.e NPM serve after creating project vue3 project using CLI #7440

Open
surapuramakhil opened this issue Dec 9, 2023 · 1 comment

Comments

@surapuramakhil
Copy link

Vue version

3.3.11

Link to minimal reproduction

Not applicable

Steps to reproduce

npm install -g @vue/cli
vue create
on prompts select defaults of vue3
cd project repo
npm run serve

What is expected?

web serve port should be opened. and output should be seen in UI

What is actually happening?

akhil@Akhil-S:~/build-it-better-ui$ npm run serve

[email protected] serve
vue-cli-service serve

INFO Starting development server...
ERROR Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
at Object. (/home/akhil/build-it-better-ui/node_modules/vue-loader/dist/compiler.js:14:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/akhil/build-it-better-ui/node_modules/vue-loader/dist/index.js:29:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at /home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/config/base.js:154:16
at /home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/Service.js:268:40
at Array.forEach ()
at Service.resolveChainableWebpackConfig (/home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/Service.js:268:26)
at Service.resolveWebpackConfig (/home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/Service.js:272:48) at PluginAPI.resolveWebpackConfig (/home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/PluginAPI.js:132:25)
at serve (/home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/commands/serve.js:79:31)
at Service.run (/home/akhil/build-it-better-ui/node_modules/@vue/cli-service/lib/Service.js:262:12)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

and output of this command
npm list vue @vue/compiler-sfc
[email protected] /home/akhil/build-it-better-ui
├─┬ @vue/[email protected]
│ └─┬ @vue/[email protected]
│ ├─┬ @vue/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├── @vue/[email protected]
└─┬ [email protected]
├── @vue/[email protected] deduped
└─┬ @vue/[email protected]
└── [email protected] deduped

System Info

No response

Any additional comments?

No response

@LinusBorg LinusBorg transferred this issue from vuejs/core Dec 9, 2023
@zhyib
Copy link

zhyib commented Nov 12, 2024

I have met the same issue as yours, and it is because my Nodejs version is too low (node12) which does not support vue>=3.3.

This exception happens when vue-loader tries to require vue/compiler-sfc, and since the ?. syntax is not supported by node12, the "require" action will throw an Error. This exception description says like "requires vue (>=3.2.13) or @vue/compiler-sfc", but this reason is not correct actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants