Hi, when i try start my proyect i get this error TypeError: cb.apply is not a function but, i don’t have that in my code… this starts to happend me when i update Node
Please at least do a Google search before putting a question here. I found this as the first result on a Google search with some possible solutions.
Please note: Glitch uses pnpm
so replace npm
with pnpm
if you use any commands
i did it, but i didn’t find anything
I gave a link. It was the first result. Try the solutions there
i try it, but again, that didn’t work for me
Can you send the contents of your package.json
file?
Please mark the file contents as code using three backticks (`) before and after the code when sending on the forum
"//1": "describes your app and its dependencies",
"//2": "https://docs.npmjs.com/files/package.json",
"//3": "updating this file will download and update your packages",
"name": "hello-express",
"version": "0.0.1",
"description": "A simple Node app built on Express, instantly up and running.",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"base-64": "^0.1.0",
"canvas": "^2.6.1",
"cleverbot-free": "^1.0.4",
"common-tags": "^1.8.0",
"cowsay": "^1.4.0",
"dblapi.js": "^2.4.0",
"discord.js": "^11.5.1",
"express": "^4.17.1",
"fs": "^0.0.2",
"get-image-colors": "^2.0.1",
"mal-scraper": "^2.7.1",
"marsnpm": "^0.4.7",
"mech-aki": "^0.1.3",
"megadb": "^3.4.0",
"moment": "^2.27.0",
"moment-duration-format": "^2.2.2",
"ms": "^2.1.2",
"npm-module-search": "^3.0.0",
"on-finished": "^2.3.0",
"owofy": "^1.0.1",
"pacman-djs": "^1.0.0",
"path": "^0.12.7",
"request": "^2.88.2",
"snekfetch": "^4.0.4",
"string-similarity": "^4.0.2",
"util": "^0.12.3",
"weather-js": "^2.0.0",
"weez": "^1.6.2",
"yandex-translate-api": "^1.0.1"
},
"engines": {
"node": "12.x"
},
"repository": {
"url": "https://glitch.com/edit/#!/hello-express"
},
"license": "MIT",
"keywords": [
"node",
"glitch",
"express"
]
}
Looks good to me. To clarify, have you tried this command in the Glitch terminal:
pnpm clean cache —force
That don’t reply anything, i just get back the pnpm commands
The cache clean did nothing for me either (running it against npm directly said command not found, so obviously this is entirely outdated advice. I don’t know what a new equivalent command is.). However, what did work for me was removing the last package I added from package.json, and then running refresh
from the terminal. I was then able to successfully install an equivalent package that did not cause npm to break.
My own searching done as someone who understands technical jargon and the underlying technologies suggested that this error happens when a package is too old to be compatible with the current version of npm. You can always search for a package on www.npmjs.com to see how old it is and how many people think it’s good quality.
(Also, fyi, Google tailors it’s search results to your past browsing & search history. Please do not assume someone has not tried searching for their question already. What is the first result for you might be buried on page three or worse for someone else. I have had Google immediately drop a page from my search results when I re-ran a search, because I’d accidentally closed that page too quickly and the algorithm assumed I found it irrelevant.)