如题

如题

在地址栏输入cmd打开 

Microsoft Windows [版本 10.0.18363.1316]

(c) 2019 Microsoft Corporation。保留所有权利。


E:\vue\my-project\vue去哪儿首页\vue去哪儿 --首页>npm install

npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})


audited 1276 packages in 14.615s


42 packages are looking for funding

  run `npm fund` for details


found 17 vulnerabilities (3 low, 8 moderate, 6 high)

  run `npm audit fix` to fix them, or `npm audit` for details


E:\vue\my-project\vue去哪儿首页\vue去哪儿 --首页>npm run dev


> my-project@1.0.0 dev E:\vue\my-project

> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js


 13% building modules 25/31 modules 6 active ...index=0!E:\vue\my-project\src\App.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.

 95% emitting


 DONE  Compiled successfully in 11353ms                                                                      下午4:38:18


 I  Your application is running here: http://localhost:8080

                                                            


打开后界面是

http://img1.sycdn.imooc.com//climg/6007eb4a09d2caf916280964.jpg

不对吧 这个源码应该是一个app界面


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕慕子 2021-01-20 17:40:16

同学你好,同学截图中启动的项目,与老师测试启动源码界面是不同的,如下图所示:

http://img1.sycdn.imooc.com//climg/6007f6eb092c7fff16690825.jpg

猜测同学可能启动的不是源码,或者修改了源码。建议:同学参考如下步骤重新下载源码,然后再测试下

1、在资料区域下载源码

http://img1.sycdn.imooc.com//climg/6007f73209a5c34519130720.jpg

2、解压到当前文件夹,如下图所示:

http://img1.sycdn.imooc.com//climg/6007f7dd096315f201260218.jpg

3、进入到源码项目目录"vue去哪儿 --首页/travel"下,如下图所示:

http://img1.sycdn.imooc.com//climg/6007f7fc09c83ed204790321.jpg

4、在地址栏cmd回车打开命令窗口,执行npm install命令安装项目所需要的所有依赖

http://img1.sycdn.imooc.com//climg/6007f82809b3999506450213.jpg

5、执行npm run dev 启动项目

http://img1.sycdn.imooc.com//climg/6007fa5409421d9b06160123.jpg

6、在浏览器中访问项目,界面如下:

http://img1.sycdn.imooc.com//climg/6007fa7d09973e8210240915.jpg

祝学习愉快~

  • 老师,我按照这个步骤操作,打开之后的界面和老师的不一样。

    http://img1.sycdn.imooc.com//climg/6108b84309fd469609690409.jpg

    http://img1.sycdn.imooc.com//climg/6108b843090bd20f09760689.jpg

    http://img1.sycdn.imooc.com//climg/6108b84309cf5aca13660729.jpg

    http://img1.sycdn.imooc.com//climg/6108b8440932607208960418.jpg


    2021-08-03 11:30:30
  • 同学你好,猜测是端口号的问题,同学截图中显示的端口号是8081,如下图所示:

    http://img1.sycdn.imooc.com//climg/6108f0af093732d706700318.jpg

    建议同学将所有的cmd窗口关闭了,只启动一个项目,然后通过8080端口号访问项目测试下

    祝学习愉快~


    2021-08-03 15:31:33
  • 好的,谢谢老师,我再去试试


    2021-08-03 15:35:40
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星

相似问题

登录后可查看更多问答,登录/注册

请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师