Chromium revision is not downloaded. Run "npm install"

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/a1368783069/article/details/87262041

在使用依赖puppeteer的组件com时,使用npm install 安装组件,报错:
Chromium revision is not downloaded. Run “npm install”

解决思路:

1 先安装 puppeteer
2 删除 com组件所在项目的所有modules,即删除 node_modules。 然后重装 npm install。

说明:

1 对于 安装 puppeteer
两种思路,全局安装

sudo npm install  -g   puppeteer

安装过程中,会提示 chromium 被安装到 /usr/lib/node_modules/puppeteer/.local-chromium/
局部安装,即只安装到该项目下:

npm install  puppeteer

chromium 会被安装到 /path/to/project/node_modules/puppeteer/.local-chromium/

2 重装组件

cd /path/to/project/
rm -rf  node_modules
npm install 

参考文章:
Use Google Chrome Puppeteer
https://stackoverflow.com/questions/45903744/use-google-chrome-puppeteer

猜你喜欢

转载自blog.csdn.net/a1368783069/article/details/87262041