NPM install succeeds
NPM install fails
Deploying a react project with date-fns dependency on Ubuntu EC2 instance throws an exception:
root@ip-172-31-55-213:~/www/~proj/web# npm install react-datepicker
> [email protected] postinstall /root/www/~proj/web/node_modules/react-datepicker/node_modules/date-fns
> node ./docs/printV2Notice.js
module.js:549
throw err;
^
Error: Cannot find module '/root/www/~proj/web/node_modules/react-datepicker/node_modules/date-fns/docs/printV2Notice.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
I have:
rm -rf node_modules
Redo npm install
uninstall and reinstall react-datepicker
However I did manage to fix it, I had to sudo npm install in order to get passed it. However, this isn't a problem in any other dependency I have in any other projects.
Most helpful comment
I have:
rm -rf node_modules
Redo npm install
uninstall and reinstall react-datepicker
However I did manage to fix it, I had to
sudo npm installin order to get passed it. However, this isn't a problem in any other dependency I have in any other projects.