page-skeleton-webpack-plugin
page-skeleton-webpack-plugin copied to clipboard
使用yarn安装page-skeleton-webpack-plugin报错
他这意思是 还会去下个chrome吗
$ yarn add -D page-skeleton-webpack-plugin
yarn add v1.3.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
[-/2] ⠁ waiting...
[2/2] ⠁ puppeteer
[-/2] ⠁ waiting...
[-/2] ⠁ waiting...
error D:\studySpace\webpackDemo\webpack_skeleton_01\skeleton_demo\node_modules\puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: D:\studySpace\webpackDemo\webpack_skeleton_01\skeleton_demo\node_modules\puppeteer
Output:
ERROR: Failed to download Chromium r564778! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
是的,puppeteer 会在下载一个 Chromium 来跑 headless Chrome。
那是不是需要开墙 才能下下来
你用 npm 试一下呢
一样的 都是无法下载 Chromium
那你翻墙试试
翻墙也试了 一样失败T^T 我还手动下载了个Chromium..也不行..不知道是不是在公司的原因 回头我回家了再试试好了
👌
hey 我又来了 现在插件是安装上了 不过我npm run dev
后 报了个无法找到模块webpack-log的错误 不知道是因为什么。我项目是通过vue-cli创建的 在webpack.dev.conf.js引入插件配置的,如下:
const { SkeletonPlugin } = require('page-skeleton-webpack-plugin')
...
new SkeletonPlugin({
pathname: path.resolve(__dirname, '../static'), // 用来存储 shell 文件的地址
routes: ['/'] // 将需要生成骨架屏的路由添加到数组中
}),
script用的也是vue-cli默认的。不知道是不是这个原因
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
}
没事了= = webpack-log 原来的模块没安装上 我这边重新安装后就可以了 thx
@ZhengXiaowei 老哥,我 webpack-log
也看到了报错
18 verbose node v8.11.3
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
22 error Exit status 1
23 error Failed at the [email protected] dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
应该怎么做呢
@BlackEyeByLee 我错误和你不一样的啊 我之前的错误是webpack-log
没安装报的错,你这个好像是指令问题
@ZhengXiaowei 嗯,我查了一下,是不同的安装方式导致路径的问题好像,清了modules再装一次好像就好了
@ZhengXiaowei 我也是安装page-skeleton-webpack-plugin时报错,你是怎么解决的? 安装命令: npm install --save-dev page-skeleton-webpack-plugin
报错: ERROR: Failed to download Chromium r594312! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download. Error: Download failed: server returned code 504. URL: https://storage.googleapis.com/chromium-browser-snapshots/Mac/594312/chrome-mac.zip at response (/node_modules/puppeteer/lib/BrowserFetcher.js:233:21) at ClientRequest.requestCallback (/node_modules/puppeteer/lib/BrowserFetcher.js:289:7) at Object.onceWrapper (events.js:254:19) at ClientRequest.emit (events.js:159:13) at HTTPParser.parserOnIncomingClient (_http_client.js:550:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:117:23) at Socket.socketOnData (_http_client.js:439:20) at Socket.emit (events.js:159:13) at ClientRequest.onsocket (/node_modules/https-proxy-agent/index.js:182:14) at Object.onceWrapper (events.js:254:19) npm WARN [email protected] requires a peer of vue@^2.5.2 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] No repository field. npm WARN [email protected] No license field. npm WARN The package semver is included as both a dev and production dependency.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
同上,翻墙也是解决不了.
同上,翻墙也是解决不了. npm i --save puppeteer --ignore-scripts
npm config set puppeteer_download_host https://cdn.npm.taobao.org/dist
@ronyland 多装几次就好了,后来回家 用家里的网络重新装了下 就ok了 主要那个chromium很容易弄到一半就失败
这个issue https://github.com/ElemeFE/page-skeleton-webpack-plugin/issues/20 也提出了解决方案 在淘宝镜像上先下载 chromium,再改下 plugin 对应的puppeteer 启动路径,指向本地版本即可