Closed csvan closed 5 years ago
Update: This is due to https://github.com/yarnpkg/yarn/issues/1538.
PhantomJS should better handle cases where npm_config_tmp
is not provided, which will always be the case with Yarn.
先全局安装 install phantomjs in global: brew install phantomjs 然后安装能得到正确的提示: PhantomJS is already installed on PATH at /usr/local/bin/phantomjs
It looks like this has been fixed by 5e6598f3f12f510aada8f5b97f8debdc36b5c160, included in v2.1.8:
if (!candidatePath) continue
Now if the npm_config_tmp
environment variable is undefined
, it won't get used it to build a test temp path.
(If you're finding this bug because you're using prerender-spa-plugin
, that package has an open issue to upgrade from phantomjs-prebuilt
v2.1.7 where it's currently stuck due to a Windows problem -- see chrisvfritz/prerender-spa-plugin#36.)
@dcecile I am using 2.1.14 and can confirm that this does not solve the issue unfortunately. The failure still happens.
@csvan Are you getting the same error as above?
[ERROR] Phantom installation failed TypeError: Path must be a string. Received undefined
[ERROR] at assertPath (path.js:7:11)
[ERROR] at Object.join (path.js:1211:7)
[ERROR] at findSuitableTempDirectory (/opt/balthazar/workdir/web/node_modules/phantomjs/install.js:127:30)
Closing since phantomjs is dead.
I have a dependency on 2.1.14, and trying to run
yarn install
(v0.20.3) on Linux (CentOS) yields the following:However, on Windows 7 (Cygwin) it works fine.
Related: https://github.com/yarnpkg/yarn/issues/1016