npm install报错:chromedriver@2.27.2 install: node install.js
2020-04-02 13:19
1791 查看
报错:
刚开始以为是 node 或 npm 版本问题,前前后后折腾了好久,终于解决了
解决:
- 如果执行过
npm install
,先删除 node_modules 文件夹,不然运行的时候可能会报错 - 执行下面的命令
npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
- 再执行
npm install
即可正常下载
分析:
经分析发现,某些版本下,chromedriver 的 zip 文件 url 的响应是 302 跳转,而在 install.js 里使用的是 Node.js 内置的 http 对象的 get 方法无法处理 302 跳转的情况;而在另外一些情况下,则是因为 googleapis.com 被墙了,此时即使采用科学 上网的方法也仍然无法获取文件。
参考:
相关文章推荐
- 运行npm install报错 ——chromedriver@2.40.0 install: `node install.js`
- npm ERR! errno 1 npm ERR! chromedriver@2.35.0 install: `node install.js`
- npm ERR! chromedriver@2.46.0 install: `node install.js`
- vue-cli 手脚架搭建 vue 环境报错 chromedriver@2.24.1 install: `node install.js` Exit status 1
- nodejs+express工程 在npm install之后或使用npm install bootstrap命令安装bootstrap之后
- npm install Error:EPROTO: protocol error, symlink '../mime/cli.js' -> '/vagrant/src/nodejs/node_modules/express/node_modules/send/node_modules/.bin/mime'
- webstorm+nodejs+JetBrains IDE Support+chrome打造前端开发神器
- ubuntu make install node JS
- node.js install on linux 5.4
- How to Install Node.js
- npm install错误chromedriver@2.33.2 install: `node install.js`
- HOW TO: Install Chromedriver for Mac OS X / Selenium / Python
- Windows下Node.js执行npm install 失败
- 报错 chromedriver@2.35.0 install: `node install.js`
- How to install Node.js on Linux
- install nodejs on ubuntu
- Trouble install node.js with homebrew
- npm install:ChromeDriver installation failed Error with http(s) request: Error: read ETIMEDOUT
- node.js认识学习三:npm install 本地安装与全局安装的区别