In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "vuejs how to install dependency", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "vuejs how to install dependency" this article.
Vuejs installation dependent methods: 1, install node and cnpm;2, install vue-cli scaffolding construction tools; 3, build the project with vue-cli; 4, open the cmd command window, use the cd command to enter the specific project folder; 5, execute the "cnpm install" command to install the dependency.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
I. Development environment
Vue recommends the development environment:
Node.js: javascript runtime environment (runtime). Different systems run various programming languages directly.
Npm: the package manager under Nodejs.
Webpack: its main purpose is to prepare all static resources that need to be published on the browser side through the syntax of CommonJS, such as merging and packaging of resources.
Vue-cli: user-generated Vue project template
Second, environmental construction
Install node.js:
1. Download and install node from the node.js official website. The installation process is simple.
2. The npm version needs to be greater than 3.0. if it is lower than this version, you need to upgrade it:
# View version $npm-v2.3.upgrade npmcnpm install npm-g
3. Based on node.js, use Taobao npm image to install related dependencies. Due to the slow use of npm in China, Taobao NPM image (http://npm.taobao.org/) is recommended.
$npm install-g cnpm-- registry= https://registry.npm.taobao.org
When you're done, you can install the dependency package with cnpm instead of npm.
Third, install vue-cli scaffolding construction tools
Install global vue-cli scaffolding to help build the required template framework
Enter $cnpm install-g vue-cli# and wait for installation. Enter $vue#. If a vue message appears, it indicates success.
Fourth, build a project with vue-cli
# create a new project based on webpack template $vue init webpack my-project#. You need to make some configuration here. By default, enter This will install Vue 2.x version of the template.For Vue 1.x use: vue init webpack#1.0 my-project? Project name my-project? Project description A Vue.js project? Author runoob? Vue build standalone? Use ESLint to lint your code? Yes? Pick an ESLint preset Standard? Setup unit tests with Karma + Mocha? Yes? Setup e2e tests with Nightwatch? Yes vue-cli Generated "my-project". To get started: cd my-project npm install npm run dev Documentation can be found at https://vuejs-templates.github.io/webpack
Fifth, installation dependence
In cmd
1)。 Enter: cd my-project (project name), enter, and go to the specific project folder
2)。 Enter: cnpm install, enter and wait for a little while
When you go back to the project folder, you will find that there is an extra node_modules folder in the project structure (the contents of this file are previously installed dependencies)
6. Whether the test environment is built successfully
Method 1: enter: npm run dev in cmd
Method 2: enter: localhost:8080 in browsing (default port is 8080)
The above is all the contents of the article "how to install dependencies for vuejs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.