webpack安裝異常


webpack中文指南:https://zhaoda.net/webpack-handbook/index.html

今天中午,我用   cnpm install   重新下載了一下項目的依賴,爆了一個錯誤如下:

peerDependencies link ajv@5.5.2 in D:\work-span\travel\Travel\node_modules\_ajv-keywords@2.1.1@ajv-keywords unmet with D:\work-span\travel\Travel\node_modules\ajv(6.6.2)
peerDependencies WARNING webpack-dev-server@^3.1.14 requires a peer of webpack@^4.0.0 but webpack@3.12.0 was installed
peerDependencies WARNING webpack-cli@^3.1.2 requires a peer of webpack@^4.x.x but webpack@3.12.0 was installed
peerDependencies WARNING webpack-dev-server@3.1.14 › webpack-dev-middleware@3.4.0 requires a peer of webpack@^4.0.0 but webpack@3.12.0 was installed
deprecate autoprefixer@7.2.6 › browserslist@^2.11.3 Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
deprecate css-loader@0.28.11 › cssnano@3.10.0 › autoprefixer@6.7.7 › browserslist@^1.7.6 Browserslist 2
could fail on reading Browserslist >3.0 config used in other tools.
deprecate eslint@4.19.1 › file-entry-cache@2.0.0 › flat-cache@1.3.4 › circular-json@^0.3.1 CircularJSON
is in maintenance only, flatted is its successor.
deprecate webpack-bundle-analyzer@2.13.1 › bfj-node4@^5.2.0 Switch to the `bfj` package for fixes and new features!
Recently updated (since 2018-12-18): 9 packages (detail see file D:\work-span\travel\Travel\node_modules\.recently_updates.txt)
√ All packages installed (928 packages installed from npm registry, used 38s(network 37s), speed 529.19
kB/s, json 802(1.72MB), tarball 17.22MB)

我仔細查了一下,原來是webpack-dev-server需要webpack  4.0.0以上版本的支持,但是我的webpack才是3.12.0版本,版本不夠。

果斷拆卸

//全局拆卸webpack  

npm uninstall webpack -g

然后

//全局安裝webpack
$ npm install webpack -g


//因為webpack版本問題最好安裝現目前的穩定版
$ npm install webpack-dev-server@2.9.7 --save-dev

 

顯示如下

 

難道又出錯了。網上查看一番。我去,原來不是我的鍋;

出現這樣的原因是: fsevent是mac osx系統的,在win或者Linux下使用了 所以會有警告,忽略即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM