webpack安裝異常

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

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

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版本,版本不夠。node

果斷拆卸webpack

//全局拆卸webpack  

npm uninstall webpack -g

而後web

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


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

 

顯示以下npm

 

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

出現這樣的緣由是: fsevent是mac osx系統的,在win或者Linux下使用了 因此會有警告,忽略便可。webpack-dev-server

相關文章
相關標籤/搜索