Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku install failing on all versions from 2.29.1 #109

Closed
OP-Klaus opened this issue Jun 19, 2017 · 7 comments
Closed

Heroku install failing on all versions from 2.29.1 #109

OP-Klaus opened this issue Jun 19, 2017 · 7 comments
Labels

Comments

@OP-Klaus
Copy link

OP-Klaus commented Jun 19, 2017

Installing on Heroku since a1a96c0 produces the following:

       > chromedriver@2.30.1 install /node_modules/chromedriver
       > node install.js
       
       module.js:327
       throw err;
       ^
       
       Error: Cannot find module 'json-stable-stringify'
       at Function.Module._resolveFilename (module.js:325:15)
       at Function.Module._load (module.js:276:25)
       at Module.require (module.js:353:17)
       at require (internal/module.js:12:17)
       at Object.<anonymous> (/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js:19:20)
       at Module._compile (module.js:409:26)
       at Object.Module._extensions..js (module.js:416:10)
       at Module.load (module.js:343:32)
       at Function.Module._load (module.js:300:12)
       at Module.require (module.js:353:17)
       at require (internal/module.js:12:17)

It seems related to the ajy module and indirectly the introduction of the request module so I'm not sure who wants to take responsibility for that.

The dependency chain is:
request includes har-validator 4.2.x
har-validator includes ajy 4.x
ajy includes json-stable-stringify 1.x in its dependencies, so I'm not sure why that's happening.

@giggio
Copy link
Owner

giggio commented Jun 20, 2017

What node and npm versions are running?
Could you verify that this module json-stable-stringify is really not there? In my node_modules I get version 1.0.1, with latest node and npm installed.

@OP-Klaus
Copy link
Author

@giggio thanks for the fast reply, and sorry for my late one! I managed to reproduce the issue locally with the following steps:

  • remove node_modules
  • use Node 4/npm2 (nvm use 4)
  • npm install

@giggio
Copy link
Owner

giggio commented Jun 22, 2017

@OP-Klaus I just tried it with node 4 and npm 2 and still works. Here is the workflow I did, using Docker.

docker run -ti node:4 /bin/bash
(inside the container)
mkdir /app
cd /app
npm init -y
npm install --save chromedriver
rm node_modules -rf
npm install

This works.
Versions:
Node 4.8.3
Npm 2.15.11

If you can provide me with steps to reproduce in Docker, that would be awesome. It is a controlled environment. So we can rule out machine differences.

@OP-Klaus
Copy link
Author

That's interesting. I've narrowed it down to be reproducible with this:

docker run -ti node:4 /bin/bash
(inside the container)
mkdir /app
cd /app
npm init -y
npm install --save chromedriver
npm install --save request
npm install --save zombie
rm node_modules -rf
npm install

If I remove request or zombie, it works.

@giggio
Copy link
Owner

giggio commented Jun 23, 2017

I can confirm that under these circumstances the problem happens.
I also tried npm 6.11.0 and npm 3.10.10 (via docker node:6) and it install fine. It seems a problem with npm 2.
This is what I get:


> chromedriver@2.30.1 install /app/node_modules/chromedriver
> node install.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'extend'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/app/node_modules/request/index.js:17:29)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

I also got this error:


> chromedriver@2.30.1 install /app/node_modules/chromedriver
> node install.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'json-stable-stringify'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/app/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js:19:20)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)

I can also confirm that zombie is not affecting the installation, it made no difference in the outcome, either for success or failure of the installation.

I searched a little, and it seems this was a problem in npm2 and it was fixed only on npm3. There is a problem with dependency loading on the lifecycle. You can read more about it here: npm/npm#4134 (comment)

I suggest you update your npm, I don't think we can do anything. I am closing the issue, but feel free to comment.

@OP-Klaus
Copy link
Author

Thanks for the investigation and I agree it's not an issue with this project :)

@lock
Copy link

lock bot commented Jul 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants