简体   繁体   中英

How can I fix the error preifx 'g' is not recognised as an internal or external command?

I have confirmed node.js and npm are installed as per the screenshot attached. However I also get a message before npm version number as shown and i think its the whole reason why i cant execute some npm commands. I have tried to uninstall nodejs and remove all associated files and re-install it again with no help nor has running command prompt as an admin.

I have also tried solutions that refer to 'npm is not recognized as an internal or external command' and tried to apply with no help. I havent seen a solution that is referring to 'prefix -g' is not recognized as an internal or external command'

All help to understand what the message is all about and how to make sure that it doesnt appear will be appriciated.

在此处输入图像描述

My perseverance paid off.I found the solution here

https://github.com/npm/npm/issues/8312 . I needed to completely remove "ComSpec" variable from my Environment Variable. phew.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM