3

I am new to node.js, I want to install forever on ubuntu. But unfortunately it gives me an error. See in the Picture :

[https://i.stack.imgur.com/faV9a.png1

Thomas Ward
  • 72,494
  • 30
  • 173
  • 237
  • The system says "This is an error with npm itself, report this error". It sounds to me like you have an issue with your Node itself. Possibly if your Node is too old this will happen (since it references Node 0.12) – Thomas Ward Jan 13 '20 at 15:58
  • Ok, i will update my node to latest version. – Ahtasham Ul Hassan Jan 13 '20 at 16:02
  • 1
    FYI, please copy screen contents as test, and paste the text into your question, instead of making a screenshot and pasting the screenshot, It is much more difficult to read a screenshot compared to text. TY, – K7AAY Jan 13 '20 at 17:14
  • Does this answer your question? [How to install the latest versions of NodeJS and NPM?](https://askubuntu.com/questions/594656/how-to-install-the-latest-versions-of-nodejs-and-npm) – karel Jan 26 '20 at 23:55

1 Answers1

3

I ran into the same issue after following this tutorial to install NodeJS.

I was able to get it work by installing a more recent NodeJS.

Follow these steps:

  1. Uninstall NodeJS:
    sudo apt purge nodejs
    sudo apt autoremove
  2. Install curl to download latest NodeJS setup:
    sudo apt-get install curl
  3. Check out https://nodejs.org/ to see what is the latest LTS version.
  4. Download it:
    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    (replace "12" with the current LTS major version number).
  5. Install NodeJS (incl. npm):
    sudo apt-get install nodejs
  6. Install forever:
    sudo npm install forever -g
MA-Maddin
  • 131
  • 3