And several basic commands nodejs framework

nodejs

npm initNodejs used to create a project at the current location,
run the commandnode xxx.js

express Project Builder
npm install express
express [项目名] --view=ejs

There are four built-in folders under the root directory of the project
bin: store the project's source folder.
public: static project folder.
routers: storing routing folder.
views: template file storage folder.

Create a run after the completion of npm install
the command is to run the projectnpm start

vue framework

vue-cli, it is a tool vue vue scaffolding provided by the official, the ability to create, test, build, debug vue project.
We first need to install the global vue-cli npm install -g @vue/cli
create vue project vue create xxxxxx
Run Projectnpm run serve

Project directory, public folder is static resources.
src is the source code for the project folder, all the code for the entire project are re-src.
In the src folder, main.js is the entry file of the entire project. When you run the project, vue-cli use webpack of main.js packaged.
in src, App.vue root component corresponding to the item.
views in the store all page-level components.
components folder to store general assembly.

The project package stored in the dist folder npm run build
modify webpack packaging options, modify server configuration, etc., need to manually add a configuration file in the root directory of the project vue.config.js, when the project started, vue-cli will merge the configuration file to its original configuration file.

react framework

create-react-appProject name
npm install -g react-scripts
execution failed react when you run the project: npm run eject(configuration files visible)
using react.js directly on the page to download react.js and react-dom.js
run the projectnpm start

angular frame

Create a project ng new 项目名称
if you want to skip npm i Installation: ng new angulardemo --skip-install
Here Insert Picture Description
run the project ng serve --open
FAQ: After creating a project with the npm i can not run or cnpm i project

解决方案: 用 yarn 替代 cnpm 和 npm
1 cnpm instal @angular/cli (我的 npm 会报错);
2 ng new 的时候阻止自动安装 ng 包, 只创建 ng 目录

ng new my-app --skip-install

3 安装 yarn npm install -g yarn / cnpm install -g yarn
4 进入目录 my-app 使用 yarn 安装 ng 所依赖的包 yarn
注意: yarn 命令 等同于 npm install / cnpm install 使用 yarn 前提是先安装 yarn ,
安装使用 cnpm install -g yarn 就可以安装

nuxt project creation

npx create-nuxt-app project name

Released five original articles · won praise 4 · Views 251

Guess you like

Origin blog.csdn.net/cheng_dong/article/details/104279378