ubuntu系统下面PhantomJS not found on PATH

完整报错如下:
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Receiving...
                                  ^C
(python3.6) root@iZuf62cvmxv23irc7lrcobZ:~/saleor_docker/saleor-storefront# cnpm install [email protected]
✔ Installed 1 packages
✔ Linked 11 latest versions
[1/1] scripts.install [email protected] run "node install.js", root: "/root/saleor_docker/saleor-storefront/node_modules/[email protected]@phantomjs"
PhantomJS not found on PATH
Phantom installation failed TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1236:7)
    at findSuitableTempDirectory (/root/saleor_docker/saleor-storefront/node_modules/[email protected]@phantomjs/install.js:126:30)
    at /root/saleor_docker/saleor-storefront/node_modules/[email protected]@phantomjs/install.js:441:19
    at nextTickCallback (/root/saleor_docker/saleor-storefront/node_modules/[email protected]@kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9) TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1236:7)
    at findSuitableTempDirectory (/root/saleor_docker/saleor-storefront/node_modules/[email protected]@phantomjs/install.js:126:30)
    at /root/saleor_docker/saleor-storefront/node_modules/[email protected]@phantomjs/install.js:441:19
    at nextTickCallback (/root/saleor_docker/saleor-storefront/node_modules/[email protected]@kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
[npminstall:runscript:error] [email protected] scripts.install run "node install.js" error: RunScriptError: Run "sh -c node install.js" error, exit code 1
✖ Install fail! RunScriptError: post install error, please remove node_modules before retry!
Run "sh -c node install.js" error, exit code 1
RunScriptError: post install error, please remove node_modules before retry!
Run "sh -c node install.js" error, exit code 1
    at ChildProcess.proc.on.code (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:96:21)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

有的人觉得这么简单的问题你都不会还要写博客记录一下?

实际情况是,即使指定路径下面有这个文件(只适用于Centos和Windows,不适用于Ubuntu),你安装docker的时候还会让你重新下载,懵逼不懵逼?

/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2

最终解决方案:

cnpm install [email protected] --ignore-scripts

发布了758 篇原创文章 · 获赞 343 · 访问量 161万+

猜你喜欢

转载自blog.csdn.net/appleyuchi/article/details/104859913
今日推荐