You probably have npm installed twice, one is in /usr/local/bin
and the other in /usr/bin
.
First, you can try to remove the npm
module that has been installed by upgrading npm
. Try to run this:
rm -r /usr/local/lib/node_modules/npm
/usr/bin/npm uninstall npm
Once you have a running version of npm, install a more recent version of node before upgrading npm. Then, remove the version of your linux distribution.
If the first solution doesn’t work, another approach is to install a recent version of node (without using npm of course):
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs
Related Posts:
- How can I update NodeJS and NPM to the next versions?
- sudo: npm: command not found
- How can I update npm itself?
- How to install a previous exact version of a NPM package?
- How to solve npm error “npm ERR! code ELIFECYCLE”
- How to solve npm error “npm ERR! code ELIFECYCLE”
- npm check and update package if needed
- After command npm start “Missing script:start” error
- How to resolve Nodejs: Error: ENOENT: no such file or directory
- Please run `npm cache clean`
- What is the difference between npm install and npm run build?
- npm ERR cb() never called
- NPM clean modules
- ‘node’ is not recognized as an internal or an external command, operable program or batch file while using phonegap/cordova
- NPM Start not starting local server
- What is the –save option for npm install?
- nodemon not working: -bash: nodemon: command not found
- npm install not working in windows
- nodemon not found in npm
- nodemon not found in npm
- ExpressJS – throw er Unhandled error event
- npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
- Why am I getting “Error socket hang up” response?
- What Are “npm run dev” and “npm run prod”
- Find the version of an installed npm package
- “npm config set registry https://registry.npmjs.org/” is not working in windows bat file
- How do I uninstall a package installed using npm link?
- Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’
- ExpressJS – throw er Unhandled error event
- Error “Cannot find module ‘npmlog'” after “npm update -g”
- What is the difference between –save and –save-dev?
- error: This is probably not a problem with npm. There is likely additional logging output above
- list all globally installed modules with one command in ubuntu
- npm – “Can’t find Python executable “python”, you can set the PYTHON env variable.”
- npm update does not do anything
- Cannot find module ‘@babel/core’
- CentOS error – sudo: effective uid is not 0, is sudo installed setuid root?
- How to install npm peer dependencies automatically?
- Do I commit the package-lock.json file created by npm 5?
- How to Reinstall Broken npm
- Cannot npm install due to node-gyp: binding.gyp not found
- Downgrade npm to an older version
- `node-pre-gyp install –fallback-to-build` failed during MeanJS installation on OSX
- npm install resulting in ‘ENOENT: no such file or directory’
- node.js: cannot find module ‘request’
- When I run `npm install`, it returns with `ERR! code EINTEGRITY` (npm 5.3.0)
- E: Unable to locate package npm
- npm install errors with Error: ENOENT, chmod
- NPM self_signed_cert_in_chain
- npm WARN deprecated [email protected]: Use uuid module instead
- npm WARN package.json: No repository field
- npm “failed to parse json”
- Npm Error – Windows NT – How to resolve
- How to properly upgrade node using nvm
- How do you uninstall all dependencies listed in package.json (NPM)?
- npm start giving error in node.js
- npm install with error: `gyp` failed with exit code: 1
- npm update check failed
- NPM warn message about deprecated package
- While doing npm install getting an error as “No such file or directory open”
- Webpack – webpack-dev-server: command not found
- npm install hangs
- npm init not working and getting stuck on version
- GYP ERR! build error. stack Error: ‘make’ failed with exit code 2
- Can pm2 run an ‘npm start’ script
- npm update to specific version (and shrinkwrap)
- nvm is not compatible with the npm config “prefix” option:
- How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
- Node.js getaddrinfo ENOTFOUND
- How do I debug error ECONNRESET in Node.js?
- Missing write access in mac to /usr/local/lib/node_modules
- What does body-parser do with express?
- mongoError: Topology was destroyed
- node.js, Error: Cannot find module ‘express’
- What does the ELIFECYCLE Node.js error mean?
- Error: getaddrinfo ENOTFOUND in nodejs for get call
- How do I resolve “Cannot find module” error using Node.js?
- After $npm install, Getting Error: Cannot find module ‘../lib/utils/unsupported.js’
- NodeJS / Express: what is “app.use”?
- NodeJS – What does “socket hang up” actually mean?
- “Client network socket disconnected before secure TLS connection was established”, node 10
- Node forever /usr/bin/env: node: No such file or directory
- How to use npm jquery module?
- How Do I Uninstall Yarn
- How is an HTTP POST request made in node.js?
- Npm Please try using this command again as root/administrator
- Express.js req.body undefined
- Enabling HTTPS on express.js
- Nodemon Error: System limit for number of file watchers reached
- Nginx upstream prematurely closed connection while reading response header from upstream, for large requests
- AWS lambda function error – Unable to import module ‘index’: Error
- heroku is giving me Method not allowed
- passport.js passport.initialize() middleware not in use
- npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’
- What does ESOCKET error mean when I’m trying to send an email?
- nodemon not working properly
- How to store Node.js deployment settings/configuration files?
- How to unpack an .asar file?
- Heroku “State changed from starting to down Stopping all processes with SIGTERM”
- MongoDB data/db not found