Hero SHIMA
Hero SHIMA

Reputation: 91

npm isn't working in powershell giving error but works fine in hyper terminal

I was a react native project but it throws error everytime. I tried to add pakages to my node project earlier it throws the same error always. I've tried to update it. but It's hopeless.

PS C:\Users\sarth\Desktop\app> npm i -g react-app
C:\Users\sarth\AppData\Roaming\npm\node_modules\npm\lib\utils\replace-info.js:13
    result += cleanUrl(str.slice(index, match.index)) + match[0]
              ^

TypeError: cleanUrl is not a function
    at splitAndReplace (C:\Users\sarth\AppData\Roaming\npm\node_modules\npm\lib\utils\replace-info.js:13:15)
    at replaceInfo (C:\Users\sarth\AppData\Roaming\npm\node_modules\npm\lib\utils\replace-info.js:23:12)
    at process.exitHandler (C:\Users\sarth\AppData\Roaming\npm\node_modules\npm\lib\utils\exit-handler.js:168:26)
    at process.emit (node:events:520:28)
    at process._fatalException (node:internal/process/execution:164:25)

This error always persist when I'm using terminal like powershell and command prompt. But it work fine on a downloaded terminal called Hyper which is truly doesn't make any sense. Any help will be appreciated. Thanks in advance

Upvotes: 0

Views: 1217

Answers (1)

Denis
Denis

Reputation: 176

Try delete folder npm in path "C:\Users****\AppData\Roaming\npm" I had the same problem after updating npm version

Upvotes: 2

Related Questions