Open dgrant85 opened 7 years ago
Same here on Ubuntu 17.04 with node v8.9.0 and npm 5.5.1 trying to install BackstopJS v3.0.32.
Hmmm. No idea. This is not an issue for most users so I am guessing it’s an env issue.
Maybe you could try doing a verbose install of phantom-prebuilt by its self — maybe that would turn up some clues?
Hello All,
Same here. But I have already install the phantomJS, the backstopJS will failed to write location.js file.
System Info: node version: v8.9.1 npm version: 5.5.1 Linux: Centos 7 with https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
Would you please take time to see it?
Thank you, Ken
`Installing BackstopJS v3.0.25... /usr/bin/backstop -> /usr/lib/node_modules/backstopjs/cli/index.js
phantomjs-prebuilt@2.1.16 install /usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt node install.js
Considering PhantomJS found at /usr/bin/phantomjs Found PhantomJS at /usr/bin/phantomjs ...verifying Writing location.js file Error checking path, continuing { Error: EACCES: permission denied, open '/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/location.js' at Object.fs.openSync (fs.js:646:18) at Object.fs.writeFileSync (fs.js:1291:33) at writeLocationFile (/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/util.js:84:6) at Promise._successFn (/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/install.js:375:11) at nextTickCallback (/usr/lib/node_modules/backstopjs/node_modules/kew/kew.js:47:28) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) errno: -13, code: 'EACCES', syscall: 'open', path: '/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/location.js' } 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...
Received 22866K total.
Extracting tar contents (via spawned process)
Removing /usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1510129726637/phantomjs-2.1.1-linux-x86_64 -> /usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/phantom
Phantom installation failed { Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1510129726637/phantomjs-2.1.1-linux-x86_64' -> '/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/phantom'
errno: -13,
code: 'EACCES',
syscall: 'link',
path: '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1510129726637/phantomjs-2.1.1-linux-x86_64',
dest: '/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1510129726637/phantomjs-2.1.1-linux-x86_64' -> '/usr/lib/node_modules/backstopjs/node_modules/phantomjs-prebuilt/lib/phantom'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /headless/.npm/_logs/2017-11-08T08_28_52_880Z-debug.log The command '/bin/sh -c echo "Installing BackstopJS v${BACKSTOPJS_VERSION}..." && npm config set registry http://registry.npmjs.org/ && chmod -R 777 /usr/lib/node_modules/ && npm install -g backstopjs@${BACKSTOPJS_VERSION} && ln -s /usr/lib/node_modules /usr/bin/' returned a non-zero code: 1`
I found the followings: https://docs.npmjs.com/getting-started/fixing-npm-permissions https://github.com/npm/npm/issues/8165
Hope could help others.
For mine, I use the node6.x, and npm3.x to install the backstopjs v3.0.25 on centos7 (yum install nodejs). Then update the node6.x -> 8.9.1, npm3.x -> npm 5.5.1 Tested, it is okay.
I fixed it by setting user/group of /usr/lib/node_modules/ (OS: Ubuntu 17.04) to my user and install BackstopJS globally without sudo:
$ sudo chown -R $(id -u):$(id -g) /usr/lib/node_modules/
$ npm install -g backstopjs
No BackstopJS problem, but a npm/phantomJS one..
@tbal Thank you, it works if not installing as root! Thank you!
Using the same example as @tbal on OSX, I had to use:
$ sudo chown -R $(id -u):$(id -g) /usr/local/lib/node_modules/
$ npm install -g backstopjs
Try the following. For more info, please refer to: https://github.com/npm/npm/issues/17851#issuecomment-343666114
npm config set user 0
npm config set unsafe-perm true
npm install
I followed the instructions set out by @Kenith and this did the trick.
@garris I am encountering this issue currently. It might be due to proxy issues. However, I was thinking, should we just have a release where puppeteer is the only engine?
Hi @marcdacz -- phantom has been removed from the next release. Would be great if some people could validate the canary...
npm install -g backstopjs@canary
Cheers.
macOS 10.12.6 node -v v8.4.0 npm -v 5.4.1
Updated to latest version of backstopjs which fails at phantomjs. Relevant portion of log below.
I'll downgrade for now, but any idea what might be causing this?