Jame's Blog

前端開發心得 front-end Develop

next 初體驗

| Comments

next 初體驗

教材來源:https://scotch.io/tutorials/react-universal-with-next-js-server-side-react

步驟:

  1. npm install

    npm init -y
    npm install next --save
    
  2. add start script

    "scripts":{
    "start":"next"
    }
    
  3. npm start

       npm start
    
  4. Error

       react not found. Please install react using 'npm install react'
    react-dom not found. Please install react-dom using 'npm install react-dom'
    
  5. fix package.json

       "dependencies": {
       "next": "^2.2.0",
       "react":"^15.4.2",
       "react-dom":"^15.4.2"
     }
    
  6. than npm i

  7. npm start

Comments

comments powered by Disqus