剛試寫了一個react的項目,為了體驗一下react全家桶使用了 redux,但是redux想要配合react使用還需要 react-redux。
安裝命令: npm install react-redux --save
但是在安裝react-redux的時候遇到了一個問題,安裝失敗,報錯如下
npm ERR! cb() never called! npm ERR! This is an error with npm itself. Please report this error at: npm ERR! https://github.com/npm/npm/issues npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\AppData\Roaming\npm-cache_logs\2018-01-03T03_19_40_198Z-debug.log Error: fatal error!
然后google了好久也沒找到確切的答案,最后怒從心頭起,惡向膽邊生,直接在package.json的dependencies字段里面手動加了這個 "react-redux": "^5" 然后執行 npm install
這樣就安裝成功了。
至於具體的原因尚不了解。