Unable to update with pamac (CLI)

I have just encountered a weird issue that I can’t resolve easily. I tried to install npm in multiple ways, and finally ended up using nvm, but now I probably need to find a way to remove the previous “global npm” that I’ve installed via npm install -g npm@_VERSION_. The most confusing thing is the following:

$ which npm
/home/jazz/.nvm/versions/node/v16.5.0/bin/npm

$ npm --version
7.17.0

$ whereis npm
npm: /usr/bin/npm /home/jazz/.nvm/versions/node/v16.5.0/bin/npm /usr/share/man/man1/npm.1.gz

But when you take a look at line #72 in my output here:

https://hastebin.com/adamaperor.coffeescript

… it says:

Now using node v12.18.3 (npm v6.14.6)

How to override this version and switch to the default version of npm provided by nvm?

You are building Insomnia from source. AUR package and source code are built to use a local version of npm as you can see from lines 66 - 73 of your output. So, that’s the expected behaviour.

I’m not sure why that package is failing to build, but I will try to look into it.

For me this package builds right. I would say that from line 84:

npm ERR! correctMkdir failed to make directory /.npm/_locks

It fails when it tries to create a folder in the root folder (that is obviously wrong). A quick search in google gives me a hint that it may be related to the HOME variable. Do you have that variable set in your shell?

Other than that I can’t say much.

$ echo $HOME
/home/jazz

Does your installation of insomnia also have this (line #66 in my logs)?

Found '/var/cache/private/pamac/insomnia/src/insomnia-core-2021.4.1/.nvmrc' with version <12.18.3>

I successfully updated my system with yay. I still don’t have any idea why insomnia couldn’t be updated with pamac. I also successfully updated (built from source) joplin-desktop with pamac, so it could be a packaging issue, I guess (unless @cfinnberg was able to build insomnia from source with pamac previously)?

I can to build insomnia with pamac. I can’t say why it doesn’t work for you. As I said I think it can be something related to $HOME variable, but I cannot confirm it. Maybe the problem is in pamac in certain situations (There seem to be a problem with $HOME and pamac), but I can’t say for sure.

1 Like