Проблемы с установкой Yeoman в Windows 7

#yeoman

#yeoman

Вопрос:

Зачем Yeoman нужен .NET??

 C:windowssystem32>npm install -g yo

fullname-native@0.1.1 install C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-native
node-gyp rebuild

C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-native>node "C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C   component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-nativebuildbinding.sln]
gyp ERR! build error
stack Error: `C:windowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-native
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm WARN optional dep failed, continuing fullname-native@0.1.1
C:UsersmeAppDataRoamingnpmyo -> C:UsersmeAppDataRoamingnpmnode_modulesyocli.js
  

Итак, я установил .NET 2.0 и добавил vcbuild.exe в path

 C:Program Files (x86)Microsoft Visual Studio 8VCvcpackages
  

Но теперь я нажимаю:

 npm install -g yo

fullname-native@0.1.1 install C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-native
node-gyp rebuild


    C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-native>node "C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    ..binding.cc(2): fatal error C1083: Cannot open include file: 'iostream': No such file or directory [C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-nativebuildbinding.sln]
    gyp ERR! build error
    gyp ERR! stack Error: `C:windowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onExit (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.js:267:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
    gyp ERR! System Windows_NT 6.1.7601
    gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
    gyp ERR! cwd C:UsersmeAppDataRoamingnpmnode_modulesyonode_modulesfullnamenode_modulesfullname-native
    gyp ERR! node -v v0.10.29
    gyp ERR! node-gyp -v v0.13.1
    gyp ERR! not ok
    npm WARN optional dep failed, continuing fullname-native@0.1.1
  

Комментарии:

1. Я согласен, это довольно грустно. Особенно, когда у вас возникают трудности с установкой компонента Visual C ! Он работает на Mac без Visual c …

Ответ №1:

Я только что сам решил эту аналогичную проблему и подумал, что буду искать людей, спрашивающих об этом. Что вам нужно сделать, это установить Visual Studio 2012 или 2013. В противном случае вы можете установить .NET SDK, но я обнаружил, что для его работы мне НУЖНА Visual Studio.

.NET SDK здесь

Я не эксперт, но, насколько я понимаю, в некоторых генераторах есть различные модули, которые используют node-gyp, который затем использует собственный компилятор c для сборки. Этого нет в стандартной сборке Windows, и для их получения необходимо установить SDK или Visual Studio. (Это то, что я предполагаю, это проблема, кстати).

Для хорошей оценки я бы установил как Visual Studio 2012 или 13, так и .NET SDK. На данный момент я обнаружил, что Visual Studio 2015 не работает для меня, и мне пришлось деинсталлировать и установить 2013..

Надеюсь, это поможет!