You are not logged in.

#1 2015-06-17 05:40:08

01010101
Member
Registered: 2015-06-17
Posts: 5

[SOLVED] node package manager: command not found

I installed nodejs, and it was working fine. I updated a couple of days ago, and now npm install and npm lead to

zsh: command not found

.
Node has some naming conflicts, from what I have read. I am confused as to how the namespace for packages works, but hopefully someone can point me in the right direction with this because, while confusing, I don't think it is causing the problem. I usually execute the application as node, but it is in the repositories as nodejs. I found node in /usr/bin. I can execute npm there, but it advises that npm should be run in a normal shell with a different directory, not in /usr/bin. There was no nodejs or npm.

I removed nodejs using

pacman -Rdd nodejs

since adom has dependencies, but when I tried to reinstall using

pacman -S nodejs

, it said it was up to date and reinstalled. I updated my system and rebooted. I still can execute node but not the npm-it still returns

zsh: command not found: npm

.

I have no idea why the node package manager disappearred. I also have no idea why it would not have reinstalled with nodejs from the repo.

➜  ~  sudo pacman -Rdd node                        
[sudo] password for user: 
error: target not found: node
➜  ~  nodejs npm
zsh: command not found: nodejs
➜  ~  node npm  
module.js:338
    throw err;
          ^
Error: Cannot find module '/home/user/npm'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Last edited by 01010101 (2015-06-17 17:40:33)

Offline

#2 2015-06-17 05:41:23

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [SOLVED] node package manager: command not found

% pkgfile npm
community/npm

Online

#3 2015-06-17 05:51:21

01010101
Member
Registered: 2015-06-17
Posts: 5

Re: [SOLVED] node package manager: command not found

➜  ~  pkgfile npm
zsh: command not found: pkgfile
➜  ~  sudo pacman -S pkgfile
resolving dependencies...
looking for inter-conflicts...

Packages (1): pkgfile-15-1

Total Download Size:    0.02 MiB
Total Installed Size:   0.05 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages ...
 pkgfile-15-1-x86_64       21.6 KiB   323K/s 00:00 [######################] 100%
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
(1/1) installing pkgfile                           [######################] 100%
==> Run 'pkgfile --update' to initialize the database
➜  ~  pkgfile npm           
error: No repo files found. Please run `pkgfile --update'.
➜  ~  pkgfile --update
error: unable to write to /var/cache/pkgfile: Permission denied
➜  ~  sudo pkgfile --update
:: Updating 4 repos...
  download complete: multilib             [   224.2 KiB   372K/s  3 remaining]
  download complete: core                 [   608.8 KiB   536K/s  2 remaining]
  download complete: extra                [     6.9 MiB  2038K/s  1 remaining]
  download complete: community            [    10.9 MiB  2.55M/s  0 remaining]
:: download complete in 4.26s             <    18.6 MiB  4.37M/s  4 files    >
:: waiting for 1 process to finish repacking repos...
➜  ~  pkgfile npm          
community/npm
➜  ~  cd development/anj
➜  anj  ls
app.js  bin  bower.json  package.json  public  routes  views
➜  anj  npm install
zsh: command not found: npm

Offline

#4 2015-06-17 05:57:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] node package manager: command not found

pkgfile --help

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-06-17 06:18:19

01010101
Member
Registered: 2015-06-17
Posts: 5

Re: [SOLVED] node package manager: command not found

I read the help page, and I am not sure if I understand what you are suggesting that I need to do. Can you be a little more explicit?

The package clearly exists-it is installed in node modules and up to date. What will pkgfile help me do?

Offline

#6 2015-06-17 06:22:08

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [SOLVED] node package manager: command not found

pkgfile helps you figure out what package includes a given file.

Online

#7 2015-06-17 06:42:18

01010101
Member
Registered: 2015-06-17
Posts: 5

Re: [SOLVED] node package manager: command not found

Thank you. I now see it in /var/abs/community/npm. I have no idea what to do from here out. Care to make any other suggestions? Any ideas as to why the package may be installed and updated but not execute in the shell? Does it belong somewhere other than /community? I apologize if these are ridiculous questions. I am still kind of new to Linux.

Offline

#8 2015-06-17 07:34:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,671
Website

Re: [SOLVED] node package manager: command not found

Because you have not installed it...

Offline

#9 2015-06-17 08:10:15

phw
Member
Registered: 2013-05-27
Posts: 318

Re: [SOLVED] node package manager: command not found

npm was moved into its own package, npm. The previous posters tried to explain to you how you can find out which package you need. "pkgfile npm" will tell you which package you need for a specific command.

So just install npm and you are set.

Offline

#10 2015-06-17 09:55:21

ayekat
Member
Registered: 2011-01-17
Posts: 1,632

Re: [SOLVED] node package manager: command not found

01010101 wrote:

Thank you. I now see it in /var/abs/community/npm. I have no idea what to do from here out. Care to make any other suggestions? Any ideas as to why the package may be installed and updated but not execute in the shell? Does it belong somewhere other than /community? I apologize if these are ridiculous questions. I am still kind of new to Linux.

The files in /var/abs/... are part of the Arch Building System (ABS, you can read up on that here). There are no binaries in there.

However, I find it quite awkward that you managed to have the ABS package tree on your system without knowing anything about it...

Last edited by ayekat (2015-06-17 20:47:39)


pkgshackscfgblag

Offline

#11 2015-06-17 17:38:47

01010101
Member
Registered: 2015-06-17
Posts: 5

Re: [SOLVED] node package manager: command not found

phw wrote:

npm was moved into its own package, npm. The previous posters tried to explain to you how you can find out which package you need. "pkgfile npm" will tell you which package you need for a specific command.

So just install npm and you are set.

Thank you. I did not realize this and mistakenly thought it was still a part of node. I installed npm and everything is working now.

Offline

Board footer

Powered by FluxBB