简体   繁体   English

无法从命令提示符运行Vue Js项目

[英]Unable to Run Vue Js Project From Command Prompt

I am trying to run my vue js project but the problem is when I enter server name (main.js) , It is showing following errors message . 我正在尝试运行我的vue js项目,但问题是当我输入服务器名称(main.js)时,它显示以下错误消息。 在此处输入图片说明

Here is my project structure. 这是我的项目结构。

在此处输入图片说明

You're trying to start main.js with node main.js , but that file is located under the src subdirectory in your screenshot (ie, the command should've been node src/main.js ). 您试图使用node main.js来启动main.js ,但是该文件位于屏幕快照的src子目录下(即命令应该是node src/main.js )。

But that directory structure looks like a Vue CLI generated project, so you should instead be using the NPM scripts (see package.json for available scripts) to start the development server: 但是该目录结构看起来像是Vue CLI生成的项目,因此您应该使用NPM脚本 (有关可用脚本,请参见package.json )来启动开发服务器:

npm run serve

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM