Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postinstall breaks npm upgrade #226

Closed
jonatan-ivanov opened this issue Apr 10, 2021 · 2 comments
Closed

postinstall breaks npm upgrade #226

jonatan-ivanov opened this issue Apr 10, 2021 · 2 comments

Comments

@jonatan-ivanov
Copy link

The postinstall script breaks npm upgrade -g, here is the related line of the output of the cmd:
npm ERR! Invalid package name ".hooks": name cannot start with a period

Indeed, there is a .hooks folder: ~/.asdf/installs/nodejs/15.14.0/.npm/lib/node_modules/.hooks/postinstall (re)moving it fixes the issue.

Full Output

 ❯ npm upgrade -g                                                                                                                          
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name ".hooks": name cannot start with a period

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2021-04-10T20_36_56_004Z-debug.log
@augustobmoura
Copy link
Member

augustobmoura commented Apr 10, 2021

This is a regression introduced in npm@7, the workaround for now is to remove the .hooks folder and to run asdf reshim nodejs manually after every global install. In the meantime I will research a way of asdf-nodejs to not rely in .hooks

Related to #227

jonatan-ivanov added a commit to jonatan-ivanov/.dotfiles that referenced this issue Apr 10, 2021
…run asdf reshim nodejs

e.g.: ~/.asdf/installs/nodejs/15.14.0/.npm/lib/node_modules/.hooks/
see: asdf-vm/asdf-nodejs#226
@augustobmoura
Copy link
Member

augustobmoura commented Jul 19, 2021

This issue should be fixed in master now. I actively removed the lines of code that were creating the .hooks directory. If the problem persists, please comment below so that I open the thread again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants