Node error Cannot read property 'resolve' of undefined

前端 未结 8 2541
遇见更好的自我
遇见更好的自我 2021-02-18 23:28

I am using reactjs and am unable to install any packages using npm install. The error message I\'m getting is :

npm ERR! Cannot read property \'reso         


        
8条回答
  •  南方客
    南方客 (楼主)
    2021-02-19 00:25

    I got into this situation with an old version of the n node version switcher (~v2), having switched onto Node v12. I was able to fix it by switching to a much older version of Node it had installed using n, v8 worked for me, and then upgrade the version switcher with sudo npm install -g n.

    From there I could switch to any version of node and use npm again.

提交回复
热议问题