Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - NPM not found when using NPM SCRIPTS

If I open the integrated terminal and run npm -v it works.

Working

But, if I running it directly from NPM SCRIPTS it doesn't work.

Not working

MORE DETAIL AS REQUESTED IN COMMENT

// Edit by Fogmeister

I also have this problem, here is some more detail...

I have a test script defined in package.json...

enter image description here

When I run this script from the root folder command line using npm run test it works...

enter image description here

This script appears in the list of NPM Scripts in VS Code...

enter image description here

When I run from the NPM Scripts explorer it fails...

enter image description here

Even though it says it is running from the same folder.

like image 312
José Miguel Avatar asked Aug 10 '26 22:08

José Miguel


1 Answers

Try doing, use dnf or apt-get

sudo apt-get/dnf install npm

The npm file should be in /usr/local/bin/npm. If it's not there, install node.js again with the package on their website.

like image 52
Zunaib Imtiaz Avatar answered Aug 13 '26 19:08

Zunaib Imtiaz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!