npm semver error

asked 2018-05-25 14:22:15 -0600

varoon gravatar image
[user@localhost ~]$ npm
module.js:549
    throw err;
    ^

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
[user@localhost ~]$ ^C

I tried reinstall nodejs using sudo dnf remove nodejs ans then sudo dnf install nodejs but I get this error during install

    ......
    Installed size: 38 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/2): npm-5.6.0-1.8.11.0.1.fc2 205 kB/s | 4.3 MB     00:21    T(2/2): nodejs-8.11.0-1.fc28.x86 172 kB/s | 5.5 MB     00:32    
    ----------------------------------------------------------------
    Total                           299 kB/s | 9.8 MB     00:33     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                        1/1 
      Installing       : nodejs-1:8.11.0-1.fc28.x86_64          1/2 
      Installing       : npm-1:5.6.0-1.8.11.0.1.fc28.x86_64     2/2 
    Error unpacking rpm package npm-1:5.6.0-1.8.11.0.1.fc28.x86_64
    Error unpacking rpm package npm-1:5.6.0-1.8.11.0.1.fc28.x86_64
    error: unpacking of archive failed on file /usr/lib/node_modules/npm/node_modules/cacache: cpio: File from package already exists as a directory in system
  Running scriptlet: npm-1:5.6.0-1.8.11.0.1.fc28.x86_64     2/2 
error: npm-1:5.6.0-1.8.11.0.1.fc28.x86_64: install failed
  Verifying        : nodejs-1:8.11.0-1.fc28.x86_64          1/2 
npm-1:5.6.0-1.8.11.0.1.fc28.x86_64 was supposed to be installed but is not!
  Verifying        : npm-1:5.6.0-1.8.11.0.1.fc28.x86_64     2/2 

Installed:
  nodejs.x86_64 1:8.11.0-1.fc28                                 

Failed:
  npm.x86_64 1:5.6.0-1.8.11.0.1.fc28                            

Error: Transaction failed
[user@localhost ~]$
edit retag flag offensive close merge delete