//1. 建立package.json npm init //2. 本地安裝jspm npm install jspm --save-dev //3.建立config.js jspm init //4.安裝包 jspm install npm:underscore //5.安裝jquery jspm install jquery
1.1 jspm install react@0.14.0-rc1
安裝React的版本;若是指定版本不對的話就,直接下載最新的包: jspm install react
1.2 jspm install react-dom@0.14.0-rc1
安裝react-dom的版本,同上:jspm install react
1.3 jspm install semantic-ui
UI樣式
1.4 jspm install css
UI插件
1.5 browser-sync start --server --no-notify --files 'index.html, app/**/*.js'
建立一個服務器來監視文件的變化
1.6 npm install webpack -g
安裝webpack
1.6 npm install -g webpack webpack-dev-server
webpack服務css
sudo npm i babel-runtime@6 --save-dev
sudo npm i babel-runtime@5 --save-dev core-js@2.4.1 node_modules/babel-runtime/node_modules/core-js -> node_modules/systemjs-builder/node_modules/core-js /Users/x ├── UNMET PEER DEPENDENCY extraneous error: ENOENT: no such file or directory, open '/Users/x/node_modules/babel-core/package.json ├── babel-runtime@5.8.38 └── UNMET PEER DEPENDENCY webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc npm WARN enoent ENOENT: no such file or directory, open '/Users/x/node_modules/babel-core/package.json' npm WARN babel-loader@6.2.10 requires a peer of babel-core@^6.0.0 but none was installed. npm WARN babel-loader@6.2.10 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none was installed. npm WARN x No description npm WARN x No repository field. npm WARN x No license field. npm ERR! Darwin 16.3.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "babel-runtime@5" "--save-dev" npm ERR! node v6.2.0
rm -rf node_modules/
,而後就能夠了從新安裝就行了:html
➜ ~ sudo npm i babel-runtime@6 --save-dev /Users/x └─┬ babel-runtime@6.20.0 ├── core-js@2.4.1 └── regenerator-runtime@0.10.1 npm WARN x No description npm WARN x No repository field. npm WARN x No license field.
安裝UI樣式:node
➜ ~ jspm install semantic-ui warn Running jspm globally, it is advisable to locally install jspm via npm install jspm --save-dev. Updating registry cache... Looking up github:Semantic-Org/Semantic-UI Looking up npm:jquery Looking up github:systemjs/plugin-css ok Up to date - semantic-ui as github:Semantic-Org/Semantic-UI@^2.2.7 (2.2.7) ok Install tree has no forks. ok Install complete.
➜ ~ jspm install css warn Running jspm globally, it is advisable to locally install jspm via npm install jspm --save-dev. Updating registry cache... Looking up github:systemjs/plugin-css ok Up to date - css as github:systemjs/plugin-css@^0.1.32 (0.1.32) ok Install tree has no forks. ok Install complete.
npm ERR! Darwin 16.3.0
最外面的組件是:CommentBox
評論的列表:CommentList
評論的內容顯示:Comment
評論的內容表單:CommentForm
react