Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the download and installation of laravel5.4 and the process of environment matching

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "the download and installation of laravel5.4 and the introduction of the process of environmental collocation". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Preface

Recently, due to the needs of the project, we need to match such an environment. The things I have done before have not been used in this way. After looking for a long time on the Internet, it is either too simple or simply unworkable. I stepped on the pit for a long time and finally matched it successfully.

The process is as follows

First download laravel5.4, go directly to the official website to install the package or composer or scaffolding to download, in short, now the laravel environment can be accessed.

Open the package.json file in laravel:

"private": true, "scripts": {"dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js-progress-hide-modules-config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js-watch-progress-hide-modules-config=node_modules/laravel-mix/setup/webpack.config.js" "watch-poll": "npm run watch--watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js-inline-hot-config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production" "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js-progress-hide-modules-config=node_modules/laravel-mix/setup/webpack.config.js"}, "devDependencies": {"axios": "^ 0.15.3", "bootstrap-sass": "^ 3.3.7", "cross-env": "^ 3.2.3", "jquery": "^ 3.1.1" "laravel-mix": "0.*", "lodash": "^ 4.17.4", "vue": "^ 2.1.10"}}

Change its red part to:

"devDependencies": {"axios": "^ 0.15.3", "bootstrap-sass": "^ 3.3.7", "jquery": "^ 3.1.1", "laravel-mix": "^ 0.8.3", "cross-env": "^ 3.2.3", "lodash": "^ 4.17.4", "vue": "^ 2.1.10", "element-ui": "^ 1.2.8" "vue-loader": "^ 11.3.4", "vue-router": "^ 2.4.0"}

After that, the terminal enters the root directory of the project and runs

Cnpm install

If there is no Taobao image, you can:

Npm install / / Note: (run this command under window with-- no-bin-links).

It is important to note that when configuring the dependent libraries in the above package.json file, you should modify them according to the specific version, otherwise you will step on a lot of holes (don't ask me why I know! ~)

Then we can find that there will be one more directory under the laravel project:

Npm run dev is ready at this time, but it is still a page that comes with laravel.

So far, we have configured vue,vue-loader,vue-router,element-ui, and now it's time to install vux!

Cd to the root directory of the project, we need vue-cli scaffolding, if it is not already installed:

Npm install vue-cli-g / cnpm install vue-cli-g

After that, install vux:

Npm install vux-save

Well, it's actually pretty fast.

Because vux2 needs to be used by vux-loader, we also need to install vux-loader:

Npm install vux-loader-save

Install less-loader to compile the less source code correctly:

Npm install less less-loader-save

OK. After successful installation, sell goes to the root directory of the project, creates a new file called webpack.config.js, and configures it:

Then open the file pointed to by package.json Modification-config in the root directory and point to your current webpack.config.js file:

Save, execute after the configuration is complete:

This is the end of npm run watch's "introduction to the download and installation of laravel5.4 and the process of environmental collocation". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report