Prepare node.js,npm & webpack
- check
whether you have installed node.js on this computer and which version
node -v
npm -v
- install
download node.js
from https://nodejs.org/en/, npm
is included in.
- set CLASSPATH
如果之前安装过,会有之前的环境变量设置,检查下是否一致,会影响到后面的webpack全局安装。
- install webpack
npm install webpack -g
Create React App
npm install -g create-react-app
create-react-app hello-world
cd hello-world
npm run start
Create Vue-Cli
npm install -g vue-cli
vue init webpack projectname
?Install vue-router? Yes
? Use ESLint to lint your code? No
? Setup unit tests with Karma + Mocha? Yes
? Setup e2e tests with Nightwatch? Yes
cd projectname
npm install
npm run dev
网友评论