Pnpm and npm fails on install with 404 for 'consty' package

javascript
#1

I’m consistently getting the following error when my app tries to install packages. I am not requiring this package in my package.json so it must be a dependency but I’m not sure for what. I tried running npm ls consty and pnpm ls consty but I think because it’s not actually being installed it can’t tell me where it lives.

The package (consty) is not listed in the npm registry from what I can tell, and it’s very possible this is a typo (?) for the package ‘const’.

Occasionally the install will push through and work, but this has gotten worse the past few days and now will not install no matter how many times I try.

Any help is appreciated! Can post my package.json file contents as well if that’s helpful.

404 Not Found: https://registry.npmjs.org/consty/-/consty-1.1.2.tgz
Error: Promise rejected with value: { code: 'E404',
  uri: 'https://registry.npmjs.org/consty/-/consty-1.1.2.tgz',
  response: 
   { body: 
      { _readableState: [Object],
        readable: true,
        _events: {},
        _eventsCount: 1,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: true,
        _transformState: [Object] },
     size: 0,
     timeout: 0,
     url: 'https://registry.npmjs.org/consty/-/consty-1.1.2.tgz',
     status: 404,
     statusText: 'Not Found',
     headers: {} },
  attempts: 3,
  resource: 'https://registry.npmjs.org/consty/-/consty-1.1.2.tgz',
  message: '404 Not Found: https://registry.npmjs.org/consty/-/consty-1.1.2.tgz' }
    at /opt/nvm/versions/node/v10.15.0/lib/node_modules/pnpm/lib/node_modules/loud-rejection/index.js:27:12
    at Array.forEach (<anonymous>)
    at EventEmitter.<anonymous> (/opt/nvm/versions/node/v10.15.0/lib/node_modules/pnpm/lib/node_modules/loud-rejection/index.js:23:24)
    at EventEmitter.emit (events.js:180:13)
    at emit (/opt/nvm/versions/node/v10.15.0/lib/node_modules/pnpm/lib/node_modules/signal-exit/index.js:77:11)
    at processEmit [as emit] (/opt/nvm/versions/node/v10.15.0/lib/node_modules/pnpm/lib/node_modules/signal-exit/index.js:150:5)
    at process.exit (internal/process.js:140:15)
    at Timeout.setTimeout [as _onTimeout] (/opt/nvm/versions/node/v10.15.0/lib/node_modules/pnpm/lib/err.js:10:30)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
#2

Hello @esalling23,

I have never seen this error before, so I do not know what may be happening. Can you please try going to your package.json file, and at the top left, you should see “add package” button, could you give this a click, and type in const and click the consty package that shows up and it should install and be added to the package.json file automatically, if this does not work, then let me know!

#3

There is no ‘consty’ package listed, however adding and removing any package seems to have fixed this for now at least.

Thanks for the help! I’m going to keep an eye out for if it pops up again.

#4

I have now run into this error multiple times, causing my app to stop running and have downtime.

It’s not the best solution for me to have to uninstall and reinstall random packages just to get this error to go away. My glitch app is at https://ga-manager.glitch.me/ (it’s working right now) - is there any way someone could take a look at it to see if we can figure out the root of the problem?

So far what I know:

  • Randomly the server will run into an error due to npm modules “missing” because the install failed
  • The pnpm install fails because of the error I posted in my first comment, looking for a package “consty”
  • The “consty” package does not exist nor am I including it anywhere from what I know.

Here is my package.json file:

{
  "name": "ga-manager",
  "version": "0.0.3",
  "description": "GA Manager bot",
  "main": "bot.js",
  "scripts": {
    "start": "node bot.js",
    "debug": "node inspect bot.js"
  },
  "dependencies": {
    "@slack/client": "^4.8.0",
    "@slack/events-api": "^2.1.1",
    "app-root-path": "^2.0.1",
    "body-parser": "^1.18.3",
    "botkit": "^0.7.4",
    "botkit-storage-mongo": "^1.0.7",
    "bson": "^2.0.5",
    "cloudinary": "^1.13.2",
    "cookie-parser": "^1.4.3",
    "debug": "^3.1.0",
    "eslint": "^4.19.1",
    "eslint-config-standard": "^11.0.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-node": "^6.0.1",
    "eslint-plugin-promise": "^3.6.0",
    "eslint-plugin-standard": "^3.0.1",
    "express": "^4.16.4",
    "express-hbs": "^1.0.4",
    "fs": "^0.0.2",
    "gojs": "^1.8.14",
    "handlebars": "^4.0.11",
    "node-cmd": "^3.0.0",
    "os-utils": "0.0.14",
    "querystring": "^0.2.0",
    "request": "^2.83.0",
    "sharp": "^0.20.5",
    "sorted-object": "^2.0.1",
    "underscore": "^1.8.3",
    "wordfilter": "^0.2.6",
    "flat": "^4.1.0",
    "node-env-file": "^0.1.8"
  },
  "engines": {
    "node": "9.0.0",
    "npm": "6.4.1"
  },
  "devDependencies": {},
  "repository": {
    "type": "git",
    "url": "https://github.com/esalling23/slack-team-manager"
  },
  "eslintConfig": {
    "extends": "standard",
    "root": true,
    "env": {
      "browser": true,
      "node": true
    },
    "rules": {
      "no-var": "error"
    }
  },
  "keywords": [
    "bots",
    "chatbots",
    "slack"
  ],
  "author": "erica.salling@gmail.com"
}

Any help is really appreciated as I’d rather not have to move my application elsewhere to keep it from having consistent downtime.

Thank you!

#5

Hi Erica, I’m looking into this. I have some experience with Botkit so hopefully that will help. Have you tried using NPM yet? You can run enable-npm in the console to try it.

#6

Thank you!!

I haven’t yet but I understand the pnpm allows for more disc space - has this changed? I’ll try enabling npm now, but I’m worried I’ll then end up with space issues.

#7

Yes, pnpm means the modules won’t take up disk space. If that’s a concern I can try some things and let you know. Can I ask what you’re using for MONGO_URI= unless that’s private? Is it local?

#8

That may be a concern in the future though for right now I think it’s okay.

My database is currently hosted on mlab and the uri looks like this (user/password redacted):

mongodb://<user>:<pass>@ds143778.mlab.com:43778/ga-manager
#9

Small update: With npm enabled I am running into container stats warnings in regards to disk space. Moving forward I’d love to solve my original problem while still being able to use pnpm.

#10

I’ve been trying to figure out why it thinks consty is a thing when it isn’t. Can you try rm shrinkwrap.yaml && enable-pnpm? That might work.

#11

The thing I found was no matter what I did, consty was still in this file called shrinkwrap.yaml (you can see it on the command line by running vim shrinkwrap.yaml). It seemed to believe that consty was a dependency of Express? I finally ran shrinkwrap.yaml && enable-pnpm and it seemed to work, but I had also downgraded Express to a previous version (which hadn’t worked) so you might try that too. pnpm install express@4.16.3 . Related to these maybe?


#12

That was the most confusing part of all this to me as well!

After running that command (rm shrinkwrap.yaml && enable-pnpm) the server restarts as expected and installs everything but gives me the following warning:

Resolving: total 617, reused 616, downloaded 0, done

 WARN  Cannot find file at /rbd/pnpm-volume/aa02e967-5b5a-4e31-9053-6094e7f7d937/node_modules/consty although it was listed by readdir

Followed by that original error about “consty”. The server does run, however this was what happened previously before it would eventually crash.

I’ll try changing the express version and see if that solves anything! Really appreciate you looking into this!

#13

Yeah if that doesn’t work, happy to hop in to your project itself and try a debug, though that’s usually my last resort (I tried debugging in a remix).

#14

This is still a bit of a mystery - I get the same output if I use express version “4.16.3” vs “^4.16.4” (what I had before), though the error is not appearing anymore. This could be because of removing the shrinkwrap file, though it’s not 100% clear to me since that didn’t seem to solve anything the first time I tried it.

Happy this is working but I’m half expecting the error to pop up again. I’ll be back here if it does! Thank you for helping me with this, and if you think going into my project and debugging there would help you understand the issue then by all means.