簡體   English   中英

無法使用 npm 安裝任何東西(反應)

[英]Can't install anything with npm (react)

我已經為我的第一個 react 項目克隆了 Hot Reload Boilerplate ( https://github.com/gaearon/react-hot-boilerplate )。

幾天前可以使用npm install --save react-router安裝 React Router。 但是現在我想安裝像 Axios 這樣的依賴項來使用 JSON ( https://github.com/mzabriskie/axios ) 或這個 ReactCSSTransitionGroup 從https://facebook.github.io/react/docs/animation.html獲取數據,但是當我運行npm install axios我不斷收到這些錯誤:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "axios"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@0.14.8 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-dom@0.14.8 wants react@^0.14.8
npm ERR! peerinvalid Peer react-router@3.0.0 wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer react-addons-css-transition-group@15.3.2 wants react@^15.3.2

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ludo/Documents/sites/react/FirstApp/npm-debug.log

而且當我運行npm i東西時,我會收到以下錯誤:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@0.14.8 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-dom@0.14.8 wants react@^0.14.8
npm ERR! peerinvalid Peer react-router@3.0.0 wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer react-addons-css-transition-group@15.3.2 wants react@^15.3.2

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ludo/Documents/sites/react/FirstApp/npm-debug.log

這是什么意思,我該如何解決?

謝謝!

您使用的是舊版本的npm (2.15.9)。 運行它來更新它...

$ npm install -g npm

然后再次嘗試安裝您的依賴項。

PS C:\\Users\\a\\Desktop\\project 1> npm 版本 { npm: '8.3.0',
節點:'17.3.0',v8:'9.6.180.15-node.12',uv:'1.42.0',zlib:'1.2.11',brotli:'1.0.9',ares:'1.18.1 ', 模塊: '102', nghttp2: '1.45.1',​​ napi: '8', llhttp: '6.0.4', cldr: '40.0', icu: '70.1', tz: '2021a3', unicode: '14.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1.0-DEV' } PS C:\\Users\\a\\Desktop\\project 1> npx create-react-app my-app 需要安裝以下軟件包: create-react-app 確定繼續嗎? (y) 是

您正在運行create-react-app 4.0.3,它落后於最新版本 (5.0.0)。

我們不再支持全局安裝 Create React App。 請使用以下命令之一刪除任何全局安裝:

  • npm uninstall -g create-react-app
  • 紗線全局刪除 create-react-app

https://create-react-app.dev/docs/getting-started/

PS C:\\Users\\a\\Desktop\\project 1> npm 更新

最新,3 秒審核 1 個包裹

發現 0 個漏洞 PS C:\\Users\\a\\Desktop\\project 1> npx create-react-app my-app 需要安裝以下包: create-react-app 確定繼續? (y)

您正在運行create-react-app 4.0.3,它落后於最新版本 (5.0.0)。

我們不再支持全局安裝 Create React App。 請使用以下命令之一刪除任何全局安裝:

PS C:\\Users\\a\\Desktop\\project 1> npx clear-npx-cache 需要安裝以下包: clear-npx-cache 確定繼續? (y) y PS C:\\Users\\a\\Desktop\\project 1> npx create-react-app my-app 需要安裝以下包: create-react-app 確定繼續? (y) 是

這將工作 clear-npx-cache

如果您打開了自動保存,請嘗試取消選中它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM