prerender-spa-plugin的安装

仉伟兆
2023-12-01

1. 因npm的镜像是https://registry.npmjs.org/,下载不了依赖的chrome无头浏览器(翻墙原因)

2. 切换镜像至国内的淘宝镜像https://registry.npm.taobao.org/

3. npm install -g cnpm --registry=https://registry.npm.taobao.org

4. cnpm i prerender-spa-plugin -D

5. Chromiun浏览器下载成功

rita-lengdeMacBook-Pro:prerender rita_leng$ npm install -g cnpm --registry=https://registry.npm.taobao.org;

/usr/local/bin/cnpm -> /usr/local/lib/node_modules/cnpm/bin/cnpm

+ cnpm@6.1.1

added 686 packages from 950 contributors in 14.621s

rita-lengdeMacBook-Pro:prerender rita_leng$ cnpm i prerender-spa-plugin -D

✔ Installed 1 packages

✔ Linked 174 latest versions

[1/1] scripts.install prerender-spa-plugin@3.4.0 › @prerenderer/renderer-puppeteer@0.2.0 › puppeteer@^1.7.0 run "node install.js", root: "/Users/rita_leng/work/study/prerender/node_modules/_puppeteer@1.20.0@puppeteer"

Downloading Chromium r686378 - 110.2 Mb [====================] 100% 0.0s 

Chromium downloaded to /Users/rita_leng/work/study/prerender/node_modules/_puppeteer@1.20.0@puppeteer/.local-chromium/mac-686378

[1/1] scripts.install prerender-spa-plugin@3.4.0 › @prerenderer/renderer-puppeteer@0.2.0 › puppeteer@^1.7.0 finished in 24s

✔ Run 1 scripts

✔ All packages installed (197 packages installed from npm registry, used 27s(network 3s), speed 945.05kB/s, json 175(410.36kB), tarball 2.61MB)

rita-lengdeMacBook-Pro:prerender rita_leng$ 

 

 类似资料: