Thursday, May 16, 2024
 Popular · Latest · Hot · Upcoming
92
rated 0 times [  92] [ 0]  / answers: 1 / hits: 174693  / 3 Years ago, wed, may 19, 2021, 12:50:54

I installed node and npm using the instructions provided here



I was able to use node successfully. However, as I attempt to install the "Formidable" node module, I get the following error:



$npm install formidable
bash: /usr/local/bin/npm: /usr/local/bin/node: bad interpreter: No such file or directory


When I do a which npm I get the following output:



$which npm
/usr/local/bin/npm


I have no clue on what is wrong with npm here - any idea on how I can fix this?


More From » nodejs

 Answers
7

Taking @gertvdijk hint, I uninstalled NPM using the script:



rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*


(which can be found here)



Even after performing the above, I got another error:



$ npm install formidable  
bash: /usr/local/bin/npm: No such file or directory


So, I ran hash -r in the terminal (as per the instructions found under NPM Won't Run After Upgrade) and voila - it worked. NPM now works!


[#32856] Thursday, May 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
guialk

Total Points: 300
Total Questions: 144
Total Answers: 121

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;