Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Every time I try to update npm 6.14.13 -> 7.16.0 my terminal ignores my commands.
$ npm install -g npm
Unfortunately is not updating my npm version.
Expected Behavior
I expected to be able to update my npm 6.14.13 to 7.16.0
I'm a junior/beginner front end developer and I'd be very appreciative if somebody could help and explain what I'm doing wrong.
Steps To Reproduce
I've had this issue for a few weeks now, and I can't figure how to debug it. In today's case, I was using npm init to work with TailwindCSS. Starting with:
$ npm init -y
Resulting in the following:
mjw@laptop:~/pro2/tailwindCSS-play$ npm init -y
Wrote to /home/mjw/pro2/tailwindCSS-play/package.json:
{
"name": "tailwindCSS-play",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
╭────────────────────────────────────────────────────────────────╮
│ │
│ New major version of npm available! 6.14.13 → 7.16.0 │
│ Changelog: https://github.com/npm/cli/releases/tag/v7.16.0 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
As the fancy terminal art suggested, I ran:
$ npm install -g npm
Resulting in:
mjw@laptop:~/pro2/tailwindCSS-play$ npm install -g npm
/home/mjw/.npm-global/bin/npx -> /home/mjw/.npm-global/lib/node_modules/npm/bin/npx-cli.js
/home/mjw/.npm-global/bin/npm -> /home/mjw/.npm-global/lib/node_modules/npm/bin/npm-cli.js
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../../../lib/node_modules/npm/man/man1/npx.1
npm ERR! dest /home/mjw/.npm-global/share/man/man1/npx.1
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../../../lib/node_modules/npm/man/man1/npx.1' -> '/home/mjw/.npm-global/share/man/man1/npx.1'
npm ERR! File exists: /home/mjw/.npm-global/share/man/man1/npx.1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mjw/.npm/_logs/2021-06-05T06_04_44_852Z-debug.log
Lots of ERR's, but just to confirm that it didn't go to plan:
$ npm -v
6.14.13
My next play was to try using --force, as suggested by the terminal.
mjw@laptop:~/pro2/tailwindCSS-play$ npm install -g npm --force
npm WARN using --force I sure hope you know what you are doing.
/home/mjw/.npm-global/bin/npm -> /home/mjw/.npm-global/lib/node_modules/npm/bin/npm-cli.js
/home/mjw/.npm-global/bin/npx -> /home/mjw/.npm-global/lib/node_modules/npm/bin/npx-cli.js
+ npm@7.16.0
added 255 packages from 922 contributors in 3.925s
Alas, the result remains the same:
$ npm -v
6.14.13
I tried again, I sure wish I knew what I was doing.
mjw@laptop:~/pro2/tailwindCSS-play$ npm install -g --force npm
npm WARN using --force I sure hope you know what you are doing.
/home/mjw/.npm-global/bin/npm -> /home/mjw/.npm-global/lib/node_modules/npm/bin/npm-cli.js
/home/mjw/.npm-global/bin/npx -> /home/mjw/.npm-global/lib/node_modules/npm/bin/npx-cli.js
+ npm@7.16.0
updated 255 packages in 5.042s
Sigh:
$ npm -v
6.14.13
Environment
- OS: Ubuntu 20.04
- Node: 14.17.0
- npm: 6.14.13