npm install -g yo command gives -> ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`

前端 未结 7 557
醉梦人生
醉梦人生 2020-12-31 04:38

I just tried to do a npm install but get this error about doctor,js at the end. Do I need to worry about it?

npm install -g yo

. .



        
7条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 04:49

    I believe this may be due to the way which node was installed on your system. Apparently, sometimes when installing Node via a package manager, the linked binary is nodejs, (thus nodejs _command_ is the command that works on your machine, not the much more common node _comamand_. You can either re-install Node (the latest version is now 0.10.24) from nodejs.org, or try this solution from this related issue:

    For anyone wishing to still use their OS's package of node the simple solution for this is to determine where node is installed on your OS and then create a symbolic link.

    For example I had the issue on ubuntu and the install directory is /usr/bin. To create the symlink you can run:

    sudo ln -s /usr/bin/nodejs /usr/bin/node

    in windows you can use the mklink command.. Be sure to open the command prompt as a administrator

提交回复
热议问题