如何安装幻影-预构建?
phantomjs预构建包有时被引用为post-install脚本的一部分Artifactory的npm外部依赖重写函数不能抓。
当你的npm客户端无法访问github.com时,你的安装(使用debug -dd)可能会失败,并显示以下日志:
> phantomjs-prebuilt@2.1.9安装X:node_modulesphantomjs-prebuilt
> node install.js
在PATH上找不到PhantomJS
下载https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantom
js-2.1.1-windows.zip
保存到C:Usersc38632AppDataLocalTempphantomjsphantomjs-2.1.1-windows.z
知识产权
收到……
请求出错。
错误:connect ETIMEDOUT 192.30.253.112:443
在Object.exports。_errnoException (util.js 860:11):
在出口。_exceptionWithHostPort (util.js 883:20):
在TCPConnectWrap。afterConnect [as oncomplete] (net.js:1063:14)
如果你想阻止你的客户端机器直接访问github下载文件,那么你可以使用以下步骤:
1.手动从https://bitbucket.org/ariya/phantomjs/downloads到本地磁盘
2.在Artifactory中创建一个新的GENERIC存储库,并上传上面下载的文件。(您将无法将上面的URL作为远程存储库,因为远程URL正在阻止HEAD请求。看到//www.si-fil.com/jira/browse/RTFACT-11923有关此限制的更多详细信息)
3.添加属性到.npmrc文件(https://www.npmjs.org/doc/files/npmrc.html)
phantomjs_cdnurl = https://MY_ARTIFACTORY/artifactory/my-generic-repo-phantomjs/folder
欲了解更多信息,请访问
https://www.npmjs.com/package/phantomjs-prebuilt#downloading-from-a-custom-url
