Operation of Vue project

operationvueproject

1. install node.js( Recommended version v10.15.3)

https://nodejs.org/download/release/v10.15.3/
 Insert picture description here

  • Installation details : Baidu

2. After the installation cmd View version

node -v
npm -v

3. install cnpm( At home npm Mirror image )

npm install -g cnpm --registry=http://registry.npm.taobao.org

4. Check the version after installation

cnpm -v

5. install webpack

  • webpack Is a module loader and packaging tool , It can bring all kinds of resources together , for example JS( contain JSX)、coffee、 style ( contain less/sass)、 Pictures are used and processed as modules . webpack The core is Dependency analysis .
npm install webpack -g
npm install webpack-cli -g

6. Check the version after installation

webpack -v

7. install vue-cli

  • vue-cli yes vue.js Scaffolding , Used to automatically generate vue.js+webpack Project template
cnpm install -g vue-cli

8. Examples of use


# Cloning project
git clone https://gitee.com/y_project/RuoYi-Vue
# Enter project directory
cd ruoyi-ui
# After entering the project directory , Install dependency
npm install
# It is not recommended to use it directly cnpm Installation dependency , There will be all kinds of weird bug. It can be solved by the following operations npm The problem of slow download speed
npm install --registry=https://registry.npm.taobao.org
# Start the service
npm run dev
Browser access http://localhost:80
## Release
# Build the test environment
npm run build:stage
# Build the production environment
npm run build:prod

9. perform npm run dev Tips ERROR in Cannot find module ‘node-sass’

  • Error indicates not found node-sass modular .
 resolvent : Enter the command cnpm install [email protected]
版权声明:本文为[weixin_ forty-three million seven hundred and sixty-six thousan]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/174/202206231525148415.html