npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.44k stars 3.14k forks source link

[BUG] <sudo npm install -g npm@latest fails on circleci> update-npm #3529

Closed koitoror closed 3 years ago

koitoror commented 3 years ago

Is there an existing issue for this?

Current Behavior

-|/-|/-|/-|/-|/npm WARN engine npm@7.19.1: wanted: {"node":">=10"} (current: {"node":"4.8.2","npm":"2.15.11"}) npm ERR! Linux 4.15.0-1106-aws npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "npm@latest" npm ERR! node v4.8.2 npm ERR! npm v2.15.11 npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module '/usr/local/lib/node_modules/npm/lib/build.js' npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /home/circleci/mern-starter/npm-debug.log

Exited with code exit status 1

Expected Behavior

to work

Steps To Reproduce

  1. In this environment... circleci
  2. With this config...
  3. Run '...' sudo npm install -g npm@latest
  4. See error...

Environment

koitoror commented 3 years ago

resolved it .. the error was here - image: circleci/node:4.8.2 # Primary execution image the circleci node image needs to be version 10 and higher so i replaced it with - image: cimg/node:16.4.1 # Primary execution image