1👍
Make sure that you copy your package-lock.json
file to your server as well and not only package.json
. That way you will ensure that npm installs exactly the same versions of all packages on your server as the ones that were installed locally.
You can read more about the package-lock.json
file here.
You copy your package-lock.json
file over at any point and running npm install
will ensure that your node modules are all at the correct versions.
0👍
- Try removing
node_modules
from the server and donpm install
again - Make sure the
node
andnpm
versions — however this shouldn’t be the issue - Remove package.lock file if exist and do
npm install
again - Make sure you don’t have any errors while downloading dependencies
Source:stackexchange.com