clearbit / clearbit-node

Node library for querying the Clearbit business intelligence APIs
https://clearbit.com/docs
MIT License
69 stars 35 forks source link

NPM error on install #49

Open mdathersajjad opened 3 years ago

mdathersajjad commented 3 years ago

Installing clearbit via npm install in heroku causes ssh error. I faced this issue previously it was resolved the next day without any changes. I have attached the logs which it tries to execute.

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/clearbit/needle.git
npm ERR! 
erunion commented 3 years ago

We're seeing a variant of this also on Heroku:

-----> Building on the Heroku-20 stack
-----> Fetching heroku/nodejs buildpack...
       buildpack downloaded
-----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_PRODUCTION=false
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=test
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  14.15.1
       engines.npm (package.json):   ^7

       Resolving node version 14.15.1...
       Downloading and installing node 14.15.1...
       Bootstrapping npm ^7 (replacing 6.14.8)...
       npm ^7 installed

-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build

-----> Installing dependencies
       Installing node modules
.       npm ERR! code EINTEGRITY
       npm ERR! sha512-ILokv4FHXmekckGaMQbhjJAxSaGJoOvL5o2f/KyCq3Am4KSxKKrSuk+Y1zyK/L7fgYgYdDZZkJTsqB90pRJuOA== integrity checksum failed when using sha512: wanted sha512-ILokv4FHXmekckGaMQbhjJAxSaGJoOvL5o2f/KyCq3Am4KSxKKrSuk+Y1zyK/L7fgYgYdDZZkJTsqB90pRJuOA== but got sha512-ztxroZmgQuCUu1hxQh8qqrYwJLfI6mjZTBrXCpHxIFwGo9yRnWEEDijBFXhpRtyf2W31GJ4WBF2ouszZuldYEg==. (20912 bytes)

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.5wMDl/_logs/2021-02-21T06_40_54_130Z-debug.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/

       Love,
       Heroku

The failing integrity check also coming from clearbit/needle.

pkprosol commented 3 years ago

Any updates on this? It's happening every other time I update node packages, and might mean I can't use Clearbit going forward.

pkprosol commented 3 years ago

Actually I think I just solved this by using more recent versions of node as follows:

  "engines": {
    "node": "15.12.0",
    "npm": "7.6.3"
  }
mdathersajjad commented 3 years ago

@pkprosol just remove the package and directly call the API using axios or fetch. As for the original concern the problem doesn't seem to be with package. Just remove the package-lock.json and try to deploy it will work.

rdoyle99 commented 3 years ago

Having this same issue - deploying on Vercel. Only recently.

lino-levan commented 3 years ago

Hey All, Just wanted to explain my workaround for the issue. Looks like clearbit is using an ancient version of needle for some reason. It seems to work fine on my computer but refuses to deploy anywhere. My solution was replacing it with the open source maintained version found here.

Steps to fixing this (from my experience):

  1. Deleted your package-lock.json
  2. Run npm install --save tomas/needle
  3. In node_modules/clearbit in package-lock.json, replace the dependency on needle to github:tomas/needle
  4. In clearbit later down in the file replace the needle dependency with github:tomas/needle

Not sure if steps 3 or 4 are needed but these 4 steps worked for me. Hope this helps anyone else who runs into this issue! See attached pictures if you are having trouble understanding steps 3 and 4.

Screen Shot 2021-07-15 at 11 00 59 AM Screen Shot 2021-07-15 at 11 01 24 AM

I hope that clearbit gets around to fixing it because it seems like such an easy fix.

t0mstah commented 3 years ago

https://github.com/clearbit/clearbit-node/pull/50 needs merge @davidlumley