9

I tried to install npm and I got the following error. I already removed npm and reinstall it again, but I again got the following error:


npm ERR! Linux 4.15.0-30-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! [email protected] start: `node ./tools/server.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'node ./tools/server.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the vx-leave-system package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node ./tools/server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs vx-leave-system npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls vx-leave-system npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/seelan/Documents/vx-leave-system/npm-debug.log 

How can I fix this?

1
  • issue is probably nodejs version doesn't fit. can you post what you have in "npm-debug.log" also the package.json you have Commented Aug 14, 2018 at 14:19

6 Answers 6

18

On ubuntu 18.04 following steps saved me

To remove the distro-stable version, type the following:

sudo apt remove nodejs 

This command will remove the package and retain the configuration files.

sudo apt purge nodejs 

As a final step, you can remove any unused packages that were automatically installed with the removed package:

sudo apt autoremove 

Refresh your local package index by typing:

sudo apt update 

Enable the NodeSource repository by running the following command

(optinal) If you need to install another version, for example 14.x, just change setup_12.x with setup_14.x

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - 

Once the NodeSource repository is enabled, install Node.js and npm by typing:

sudo apt install nodejs 

Verify that the Node.js and npm were successfully installed by printing their versions:

node --version (v12.18.4) npm --version (6.14.6) 
Sign up to request clarification or add additional context in comments.

Comments

5

It seems to me that you're running a newer version of Node, but an outdated version of NPM.

You can do either of the following:

  1. Try the latest stable version of NPM:
    You can upgrade to the latest version of npm using: npm install -g npm@latest

  1. Uninstall Node form your machine completely, go to their website and install the latest stable Node version. NPM comes with it.

Comments

2

I faced this issue too today and the problem was caused by an upgrade in my node and npm version. Guess my project dependencies were still running on older versions of node and npm

I fixed it by deleting the node_modules folder and run

npm install 

I hope this helps

Comments

0

This looks like a permissions issue in your home directory. To reclaim ownership of the .npm directory execute:

sudo chown -R $(whoami) ~/.npm 

Comments

0

Check the updates of dependencies

npm outdate 

Run the next command to update dependencies

npm update 

Comments

-1

Remove the path folder directory C:\Users\ACER\AppData\Local**\npm-cache_logs\2021-12-29T13_41_22_984Z-debug-0.log**

and then run this command in your CLI npm install -g npm@latest

this works with you

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.