Redux 教程服务端渲染,里面的例子跑不通 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
请不要在回答技术问题时复制粘贴 AI 生成的内容
NicholasNC

Redux 教程服务端渲染,里面的例子跑不通

  •  
  •   NicholasNC Jul 1, 2016 3322 views
    This topic created in 3586 days ago, the information mentioned may be changed or developed.

    Redux 教程服务端渲染

    是直接在counter上面改的

    根据里面的步骤,跑不通,npm start就报错

    npm ERR! Windows_NT 10.0.10586 npm ERR! argv "D:\\software\\nodejs\\node.exe" "D:\\software\\nodejs\\node_modul es\\npm\\bin\\npm-cli.js" "start" npm ERR! node v4.4.4 npm ERR! npm v2.15.1 npm ERR! code ELIFECYCLE npm ERR! [email protected] start: `if-env NODE_ENV=production && npm run start:prod || npm run start:dev` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'if-env NODE_ENV=production & & npm run start:prod || npm run start:dev'. npm ERR! This is most likely a problem with the tutorial package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! if-env NODE_ENV=production && npm run start:prod || npm run start:d ev npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs tutorial npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls tutorial npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! D:\Nicholas\LW\testPro\redux\examples\Counter_Server_Render\npm-deb ug.log 

    看不懂,有遇到过同样问题的朋友吗?,求分享。

    7 replies    2016-07-02 21:29:54 +08:00
    robinlovemaggie
        1
    robinlovemaggie  
       Jul 1, 2016
    [email protected] 包有问题,考虑下是否是版本不兼容导致的
    NicholasNC
        2
    NicholasNC  
    OP
       Jul 1, 2016
    ```
    {
    "name": "tutorial",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
    "start": "if-env NODE_ENV=production && npm run start:prod || npm run start:dev",
    "start:dev": "webpack-dev-server --inline --content-base public --history-api-fallback",
    "start:prod": "webpack && node server.js"
    },
    "author": "",
    "license": "ISC",
    "dependencies": {
    "react": "^0.14.7",
    "react-dom": "^0.14.7",
    "react-router": "^2.0.0"
    },
    "devDependencies": {
    "babel-core": "^6.5.1",
    "babel-loader": "^6.2.2",
    "babel-preset-es2015": "^6.5.0",
    "babel-preset-react": "^6.5.0",
    "http-server": "^0.8.5",
    "webpack": "^1.12.13",
    "webpack-dev-server": "^1.14.1"
    }
    }

    ```
    是指这里面的依赖包的版本吗?
    wakiki
        3
    wakiki  
       Jul 1, 2016 via Android
    node 是不是旧了点呢
    NicholasNC
        4
    NicholasNC  
    OP
       Jul 1, 2016
    我的 node 是 v4.4.4
    NicholasNC
        5
    NicholasNC  
    OP
       Jul 1, 2016
    需要换成最新的 6.2.2 吗
    tinkerer
        6
    tinkerer  
       Jul 1, 2016 via Android
    用 nvm 管理版本不就得了…
    wssgcg1213
        7
    wssgcg1213  
       Jul 2, 2016
    @NicholasNC 你这是 windows 不支持那个 npm script 的写法
    你直接执行 npm run start:dev 就行了
    About     Help     Advertise     Blog     API     FAQ     Solana     6064 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 59ms UTC 02:33 PVG 10:33 LAX 19:33 JFK 22:33
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86