Adding libraries to v12
# 🤝help
m
i am having difficulty adding libraries using npm. I want to integrate langchain but getting an error saying im missing npmlog. i tried installing this the right way but nothing was working so i copied the npmlog file to node_modules folder and now i get a new error. I noticed that the libraries module isn't loading properly so maybe that is why. any help would be greatly appreciated
f
have you tried
npm install npmlog
, if that doesn't work, try
npm update -g
you can also try deleting node modules completely and then reinstalling, that might install npmlog:
sudo rm -rf /usr/local/lib/node_modules/
and then run
npm
m
it is saying it cant find openai.cjs
but for some reason it can find openai.js and then give an error for using require instead of import
f
Have you tried looking through these threads: https://stackoverflow.com/questions/34702617/error-cannot-find-module-npmlog-after-npm-update-g https://github.com/npm/npm/issues/11134 . I think you might have to install npm to the latest version manually and delete node then download the latest version from here https://nodejs.org/en and then try downloading Langchain. I have never got this error so I might be wrong.
m
i have redownloaded the latest version of node onto my system and am still getting gthe error. I think maybe because botpress uses its own version of node as is evident by this:
f
Yeah Im sorry, i dont know how to fix that, Id say contact Botpress support on their website
m
thanks anyway Muhammad!
they don't support v12 anymore
only on discord
I found the problem...
langchain need node 18 and uses ES Modules which were introduced in node 14
but botpress runs on node 12
15 Views