I'm trying to update my node modules globally. I'm using this command
sudo npm update -g
but it will produce thise error in terminal
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name ".DS_Store": name cannot start with a period
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dev/.npm/_logs/2021-04-24T15_59_25_014Z-debug.log
I think that the command will scan the folder and find macOS .DS_Store file.
How I can fix this?
for me doing this solve my problem :
find /usr/local/lib/node_modules/ -name '.DS_Store' -type f -delete
It search all .DS_Store and remove it in the global node_modules folder ( on Mac )
You can try this one,
sudo npm install --global npm
I think this is going to work for you