Search code examples
node.jsvue.jsnpm-installvue-cli

Error when running "npm install -g @vue/cli", reinstall attempted many times


I have been stuck on this for a long time. When i run npm install -g @vue/cli, it pops up the following error. simliar error occurs also when I run vue create project-name. I have tried reinstall many times and I have tried clean the cache as well. I am clear that the dictionary in the error " C:\Users\zhang\node_modules.bin/../node/bin/node" does not exist, but i have no idea how to fix it.

C:\Users\zhang>npm install -g @vue/cli
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm ERR! code 127
npm ERR! path C:\Users\zhang\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\core-js-pure
npm ERR! command failed
npm ERR! command D:\Program Files\git\bin\bash.exe -c node -e "try{require('./postinstall')}catch(e){}"
npm ERR! /c/Users/zhang/node_modules/.bin/node: line 8: C:\Users\zhang\node_modules\.bin/../node/bin/node: No such file or directory

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\zhang\AppData\Local\npm-cache\_logs\2021-05-02T21_16_30_121Z-debug.log

I have been stuck on this for hours and I appreciate any help from you

Thank you !


Solution

  • The WARNs is not an issue.

    It did fail to run node binaries. npm ERR! /c/Users/zhang/node_modules/.bin/node: line 8: C:\Users\zhang\node_modules\.bin/../node/bin/node: No such file or directory

    Make sure you get the right path. Or change the env PATH variable accordingly.