Cannot find module even though it is in package.json

I searched around on the support forum and I couldn’t find any existing threads that helped. I used the Add Package button to insert the request-promise module from npm. I required it in my script, but it isn’t downloading and it is saying the module cannot be found.

Here is my package.json

{
“name”: “boat”,
“version”: “0.0.1”,
“description”: “some kind of bot”,
“main”: “node index.js”,
“scripts”: {
“test”: “echo "Error: no test specified" && exit 1”,
“start”: “node index.js”
},
“engines”: {
“node”: “8.x”
},
“repository”: {
“url”: “Glitch :・゚✧
},
“author”: “pancake”,
“license”: “MIT”,
“dependencies”: {
“express”: “^4.16.2”,
“bufferutil”: “^3.0.3”,
“erlpack”: “^0.1.2”,
“node-opus”: “^0.2.7”,
“opusscript”: “^0.0.6”,
“sodium”: “^2.0.3”,
“libsodium-wrappers”: “^0.7.3”,
“uws”: “^9.14.0”,
“ws”: “^5.0.0”,
“request-promise”: “^4.2.2”
}
}

If you specify a slightly earlier version of the module than the version suggested, then the error will go away. This is a known bug were working on solving.

How earlier is “slightly earlier”?

Just not the latest - the index is a day or two behind in some cases.

1 Like

Hi @pancake,

The bug that Gareth mentioned should be fixed. Perhaps you have a watch.json specifying a very long throttle interval? In that case, changes to package.json won’t apply until the threshold is reached.

Can you share the project name with us?

The throttle is set at 2 minutes. I can probably remove it for the time being to see if it fixes.

edit: all fixed! Thanks! :slight_smile: