我在安装 yarn install 包时在 Windows 上部署项目,我收到以下错误,告诉我如何解决这个问题?
$ yarn install
yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.1.1: The platform "win32" is incompatible with this module.
info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error D:\Work\Projects\blockchain-first-template\node_modules\node-sass: Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c node scripts/build.js
Directory: D:\Work\Projects\blockchain-first-template\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe D:\Work\Projects\blockchain-first-template\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.6.1
gyp info using node@9.7.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\Work\Projects\blockchain-first-template\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\Work\Projects\blockchain-first-template\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:170:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\Work\Projects\blockchain-first-template\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\Work\Projects\blockchain-first-template\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\Work\Projects\blockchain-first-template\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:170:21) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python27\python.EXE
gyp verb check python version `C:\Python27\python.EXE -c "import platform; print(platform.python_version());"` returned: "2.7.14\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 9.7.1
gyp verb command install [ '9.7.1' ]
gyp verb install input version string "9.7.1"
gyp verb install installing version: 9.7.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 9.7.1
gyp verb build dir attempting to create "build" dir: D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build
gyp verb Not using VS2017: Could not use PowerShell to find VS2017
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build\config.gypigyp verb config.gypi checking for gypi file: D:\Work\Projects\blockchain-first-template\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: D:\Work\Projects\blockchain-first-template\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-sass\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Supreme\\.node-gyp\\9.7.1\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\Supreme\\.node-gyp\\9.7.1',
gyp info spawn args '-Dnode_gyp_dir=D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-sass',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-sass\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\Supreme\.node-gyp\9.7.1
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp verb "Release" dir needed to be created? null
gyp verb copying "node.lib" for x64 C:\Users\Supreme\.node-gyp\9.7.1\Release\node.lib
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Сборка проектов в этом решении по одному. Чтобы включить параллельную сборку, добавьте параметр "/m".
Сборка начата 03.04.2018 21:15:14.
Проект "D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build\binding.sln" в узле 1 (целевые объекты по умолчанию).
ValidateSolutionConfiguration:
Создание конфигурации решения "Release|x64".
MSBUILD : error MSB3428: Загрузка компонента Visual C++ "VCBuild.exe" невозможна. Способы решения проблемы: 1) установка .NET Framework 2.0 SDK, 2) установка Microsoft Visual Studio 2005 или 3) указание адреса компонента в системном пути, если компонент установлен в другом месте. [D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build\binding.sln]
Сборка проекта "D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build\binding.sln" завершена (целевые объекты по умолчанию) с ошибкой.
Ошибка сборки.
"D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build\binding.sln" (целевой объект по умолчанию) (1) ->
(Целевой объект _src_\libsass) ->
MSBUILD : error MSB3428: Загрузка компонента Visual C++ "VCBuild.exe" невозможна. Способы решения проблемы: 1) установка .NET Framework 2.0 SDK, 2) установка Microsoft Visual Studio 2005 или 3) указание адреса компонента в системном пути, если компонент установлен в другом месте. [D:\Work\Projects\blockchain-first-template\node_modules\node-sass\build\binding.sln]
Предупреждений: 0
Ошибок: 1
Затраченное время: 00:00:00.90
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\Work\Projects\blockchain-first-template\node_modules\node-gyp\lib\build.js:285:23)
gyp ERR! stack at ChildProcess.emit (events.js:127:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Work\\Projects\\blockchain-first-template\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\Work\Projects\blockchain-first-template\node_modules\node-sass
gyp ERR! node -v v9.7.1
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
您需要为您的操作系统安装 Visual Studio 2015。