Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

npm install failed for version 2.1.7 #782

Open
vinodtelang-sdn opened this issue Mar 7, 2018 · 6 comments
Open

npm install failed for version 2.1.7 #782

vinodtelang-sdn opened this issue Mar 7, 2018 · 6 comments

Comments

@vinodtelang-sdn
Copy link

Have tried to install version 2.1.7, but it failed.

npm install [email protected] --save

@adrianjarc
Copy link

adrianjarc commented Mar 12, 2018

Same happening here (happened today).
Here is my log from console when i run npm i:


> [email protected] install /home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/phantomjs-prebuilt
> node install.js

/home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/sntp/lib/index.js:19
exports.time = async function (options = {}) {
                    ^^^^^^^^

SyntaxError: Unexpected token function
   at exports.runInThisContext (vm.js:53:16)
   at Module._compile (module.js:387:25)
   at Object.Module._extensions..js (module.js:422:10)
   at Module.load (module.js:357:32)
   at Function.Module._load (module.js:314:12)
   at Module.require (module.js:367:17)
   at require (internal/module.js:20:19)
   at Object.<anonymous> (/home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/hawk/lib/index.js:5:16)
   at Module._compile (module.js:413:34)
   at Object.Module._extensions..js (module.js:422:10)

npm ERR! Linux 4.4.0-116-generic
npm ERR! argv "/home/adrian/.nvm/versions/node/v5.12.0/bin/node" "/home/adrian/.nvm/versions/node/v5.12.0/bin/npm" "i"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.

and running npm i --verbose:

> [email protected] install /home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/phantomjs-prebuilt
> node install.js

/home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/sntp/lib/index.js:19
exports.time = async function (options = {}) {
                     ^^^^^^^^

SyntaxError: Unexpected token function
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/hawk/lib/index.js:5:16)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~install: PATH: /home/adrian/.nvm/versions/node/v5.12.0/lib/node_modules/npm/bin/node-gyp-bin:/home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/phantomjs-prebuilt/node_modules/.bin:/home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/.bin:/home/adrian/work/mightyfields/worker/node_modules/.bin:/home/adrian/.nvm/versions/node/v5.12.0/bin:/home/adrian/.sdkman/candidates/gradle/current/bin:/home/adrian/.nvm/versions/node/v5.12.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/jdk1.8.0_162/bin:/home/adrian/Android/Sdk/platform-tools:/home/adrian/Android/Sdk/tools:/home/adrian/Android/Sdk/tools/bin:/usr/local/poedit-1.8.13/src
npm verb lifecycle [email protected]~install: CWD: /home/adrian/work/mightyfields/worker/node_modules/phantom/node_modules/phantomjs-prebuilt
npm info lifecycle [email protected]~install: Failed to exec install script
npm verb unlock done using /home/adrian/.npm/_locks/staging-8097edc6fde9be22.lock for /home/adrian/work/mightyfields/worker/node_modules/.staging
[email protected] /home/adrian/work/mightyfields/worker
└── (empty)

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm verb stack Error: [email protected] install: `node install.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/home/adrian/.nvm/versions/node/v5.12.0/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
npm verb stack     at emitTwo (events.js:100:13)
npm verb stack     at EventEmitter.emit (events.js:185:7)
npm verb stack     at ChildProcess.<anonymous> (/home/adrian/.nvm/versions/node/v5.12.0/lib/node_modules/npm/lib/utils/spawn.js:24:14)
npm verb stack     at emitTwo (events.js:100:13)
npm verb stack     at ChildProcess.emit (events.js:185:7)
npm verb stack     at maybeClose (internal/child_process.js:850:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
npm verb pkgid [email protected]
npm verb cwd /home/adrian/work/mightyfields/worker
npm ERR! Linux 4.4.0-116-generic
npm ERR! argv "/home/adrian/.nvm/versions/node/v5.12.0/bin/node" "/home/adrian/.nvm/versions/node/v5.12.0/bin/npm" "i" "--verbose"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]

npm ERR! code 1

@nick13jaremek
Copy link

nick13jaremek commented Mar 12, 2018

Same problem here.

It seems the issue is in the request package. Six days ago, it upgraded its hawk dependency from version 6.x to version 7.x, as seen in this commit:

request/request@cfd2307

This hawk library uses the sntp library which appears on the logs provided by @TheDeathStreaker.

phantomsjs relies on the request library, but uses a caret to allow npm to install minor and patch versions.

Since request applied the previously referenced commit and upgraded the dependency version as a patch from version 2.8.40 to 2.8.41, the phantomjs repo is broken on installation for several node versions (mine is version 6.9.5).

EDIT:

I missed out the versioning on the request library. There was an minor version upgrade, from 2.83.0 to 2.84.0, which is the culprit of the error described in this issue.

Therefore:
It would be better to have a fixed request version in the phantomjs package.json file, namely 2.83.x .

@juansev
Copy link

juansev commented Mar 12, 2018

for your information, the versions 2.1.14 and below are working. downgrade in the meanwhile if possible

npm install [email protected]

@nick13jaremek
Copy link

I created pull request #783 to resolve this issue.

rubenmoya added a commit to CartoDB/grunt-lib-phantomjs that referenced this issue Mar 12, 2018
nick13jaremek added a commit to reclamador/karma-phantomjs-launcher that referenced this issue Mar 12, 2018
…M dependency issues. See issue #782 on the original PhantomJS repository: Medium/phantomjs#782.
@Wlada
Copy link

Wlada commented Mar 12, 2018

Can someone merge pull above?

@smec-cgint
Copy link

smec-cgint commented Mar 16, 2018

Downgrading to versions 2.1.14 worked for us as well for the moment.
A solution that supports using newer versions would be nice though

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants