第一次运行前端项目

首先node 和 npm 环境就不说了,是肯定准备好了的。

 

比如 renren-fast-vue 这个开源项目,clone 下来后,就会做 npm install,让它下载 package.json 文件的各个 module。

通常会遇到的问题如下。

 

1、没有Python的环境

之前没有装过这个 python,而且要求是 2.7 版本 。

自己来安装吧。给Path添加两个环境变量。

C:\Python27
C:\Python27\Scripts

 

2、node-sass报错

npm ERR! node-sass@4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.9.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

解决办法是,先删除 ,再安装 。

npm uninstall node-sass
npm install node-sass

 

3、windows的编译环境问题

#npm install# MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"

解决办法是,自己去下载安装  Visual C++ 2015 Build Tools 这个工具。再去执行 npm install --msvs_version 2015。

这个步骤,做好后,我重启了电脑。

 

成功的结果

PS D:\appdev\www\atguigu\renren-fast-vue> npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})


up to date in 8.703s


 

npm run dev 的正常结果

> renren-fast-vue@1.2.2 dev D:\appdev\www\atguigu\renren-fast-vue
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 31% building modules 177/199 modules 22 active ...w\atguigu\renren-fast-vue\src\App.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 66% building modules 676/712 modules 36 active ...vue\src\components\icon-svg\index.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 738/776 modules 38 active ...\modules\sys\config-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 742/777 modules 35 active ...-vue\src\views\modules\sys\config.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 757/787 modules 30 active ...en-fast-vue\src\views\main-navbar.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 759/788 modules 29 active ...e\src\views\main-sidebar-sub-menu.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 760/789 modules 29 active ...n-fast-vue\src\views\main-sidebar.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 762/790 modules 28 active ...n-fast-vue\src\views\main-sidebar.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 764/792 modules 28 active ...gu\renren-fast-vue\src\views\main.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 765/793 modules 28 active ...\src\views\modules\oss\oss-config.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 766/794 modules 28 active ...ast-vue\src\views\modules\oss\oss.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 767/795 modules 28 active ...\src\views\modules\oss\oss-upload.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 768/797 modules 29 active ...ast-vue\src\views\modules\sys\log.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 770/798 modules 28 active ...ws\modules\sys\menu-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 773/802 modules 29 active ...st-vue\src\views\modules\sys\menu.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 775/803 modules 28 active ...st-vue\src\views\modules\sys\role.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 778/805 modules 27 active ...n-fast-vue\src\views\main-content.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 780/807 modules 27 active ...ws\modules\sys\role-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 782/809 modules 27 active ...ws\modules\sys\user-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 784/811 modules 27 active ...st-vue\src\views\modules\sys\user.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 792/820 modules 28 active ...ue\src\views\modules\job\schedule.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 797/826 modules 29 active ...odules\job\schedule-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 67% building modules 798/828 modules 30 active ...rc\views\modules\job\schedule-log.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 808/833 modules 25 active ...en-fast-vue\src\views\common\home.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 809/834 modules 25 active ...n-fast-vue\src\views\common\login.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 810/835 modules 25 active ...ren-fast-vue\src\views\common\404.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 814/838 modules 24 active ...n-fast-vue\src\views\common\theme.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 816/843 modules 27 active ...n-fast-vue\src\views\demo\echarts.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 68% building modules 819/847 modules 28 active ...n-fast-vue\src\views\demo\ueditor.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a 
filepath so one can be inferred.
 95% emitting                                                                           

 DONE  Compiled successfully in 13934ms                                                                                                                                                                                18:17:58
 I  Your application is running here: http://localhost:8001

 

要是配合 renren-fast 后端项目,联调。

访问  http://localhost:8001 。 默认用户名和密码是,admin 。

 

 


 

 

posted on 2020-06-16 17:58  wuyicode  阅读(2171)  评论(0编辑  收藏  举报