Node error Cannot read property 'resolve' of undefined

前端 未结 8 2583
遇见更好的自我
遇见更好的自我 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:09

    I installed Node sometime ago (approximately 1 year ago) and npm worked properly. The node version was 10.15.3. After the install and having written a few small apps - I did not work with Node again until today. Trying to install express with npm - I got the error of: "npm ERR! Cannot read property 'resolve' of undefined" even though it had worked previously. Noting that the Node version was old, I uninstalled and installed the latest version. In my case, I installed into the c:\NodeJs folder (where it was installed previously). This made no difference - I got the same error. I then uninstalled and re-installed into the default folder of c:\Program Files\nodejs and npm works again. Hopefully this might help someone else

提交回复
热议问题