当我尝试安装依赖项和模块时,如何在Yarn中修复此长错误?我甚至不确定如何解释它。我认为它给了我3个不同的错误,但我不知道首先关注哪个错误。一个'错误'(?)表示无法找到Python2,但之后它确实找到了它。我有\ python2 \ python.exe和\ python3 \ python.exe,但Python 3是我的第一个路径。最后一行表示某些内容是可选的,但是当它出现多个错误时,它没有说明它正在讨论哪个模块。一个'错误'是指Microsoft SDK,但该项目是由Macintosh上的某个人创建的!为什么它依赖于Windows?
我想我已经不喜欢Yarn了。它过于冗长,不必要地重复使用'gyp动词'和太多的反斜杠,而且完全模糊。
C:\Users\Chloe\workspace\catalyst_research>yarn install
yarn install v1.5.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.1.2: The platform "win32" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
[1/2] ? node-zopfli: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
[2/2] ? node-sass: Build failed with error code: 1
[-/2] ? waiting...
[-/2] ? waiting...
error An unexpected error occurred: "C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass: Command failed.
Exit code: 1
Command: C:\\windows\\system32\\cmd.exe
Arguments: /d /s /c node scripts/build.js
Directory: C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass
Output:
Building: C:\\Program Files\
odejs\
ode.exe C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-gyp\\bin\
ode-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\\\
odejs\\\
ode.exe',
gyp verb cli 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp\\\\bin\\\
ode-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.2
gyp info using node@9.10.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 (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:13:12)
gyp verb `which` failed at F (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:68:19)
gyp verb `which` failed at E (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:80:29)
gyp verb `which` failed at C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:89:16
gyp verb `which` failed at C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\isexe\\index.js:42:5
gyp verb `which` failed at C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_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 (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:13:12)
gyp verb `which` failed at F (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:68:19)
gyp verb `which` failed at E (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:80:29)
gyp verb `which` failed at C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\which\\which.js:89:16
gyp verb `which` failed at C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\isexe\\index.js:42:5
gyp verb `which` failed at C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\\isexe\\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:170:21)
gyp verb `which` failed stack: 'Error: not found: python2\
at getNotFoundError (C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\\which\\\\which.js:13:12)\
at F (C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\\which\\\\which.js:68:19)\
at E (C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\\which\\\\which.js:80:29)\
at C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\\which\\\\which.js:89:16\
at C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\\isexe\\\\index.js:42:5\
at C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\\isexe\\\\windows.js:36:5\
at FSReqWrap.oncomplete (fs.js:170:21)',
gyp verb `which` failed code: 'ENOENT' }
gyp verb check python checking for Python executable \"python\" in the PATH
gyp verb `which` succeeded python C:\\Python36\\python.EXE
gyp verb check python version `C:\\Python36\\python.EXE -c \"import platform; print(platform.python_version());\"` returned: \"3.6.5\\r\
\"
gyp verb could not find \"C:\\Python36\\python.EXE\". checking python launcher
gyp verb check python launcher python executable found: \"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\
\"
gyp verb get node dir no --target version specified, falling back to host node version: 9.10.1
gyp verb command install [ '9.10.1' ]
gyp verb install input version string \"9.10.1\"
gyp verb install installing version: 9.10.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.10.1
gyp verb build dir attempting to create \"build\" dir: C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build
gyp verb build dir \"build\" dir needed to be created? C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-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: C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build\\config.gypi
gyp verb config.gypi checking for gypi file: C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\config.gypi
gyp verb common.gypi checking for gypi file: C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\common.gypi
gyp verb gyp gyp format was not specified; forcing \"msvs\"
gyp info spawn C:\\Python27\\python.exe
gyp info spawn args [ 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-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 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-sass\\\\build\\\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp\\\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Users\\\\Chloe\\\\.node-gyp\\\\9.10.1\\\\include\\\
ode\\\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\\\Users\\\\Chloe\\\\.node-gyp\\\\9.10.1',
gyp info spawn args '-Dnode_gyp_dir=C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Chloe\\\\.node-gyp\\\\9.10.1\\\\<(target_arch)\\\
ode.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-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 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-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\\Chloe\\.node-gyp\\9.10.1
gyp verb found first Solution file build/binding.sln
gyp verb could not find \"msbuild.exe\" in PATH - finding location in registry
gyp info spawn C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.
Build started 3/30/2018 10:40:15 PM.
Project \"C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build\\binding.sln\" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration \"Release|x64\".
MSBUILD : error MSB3411: Could not load the Visual C++ component \"VCBuild.exe\". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server
2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008. [C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build\\binding.sln]
Done Building Project \"C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build\\binding.sln\" (default targets) -- FAILED.
Build FAILED.
\"C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build\\binding.sln\" (default target) (1) ->
(libsass target) ->
MSBUILD : error MSB3411: Could not load the Visual C++ component \"VCBuild.exe\". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008. [C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass\\build\\binding.sln]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.02
gyp ERR! build error
gyp ERR! stack Error: `C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-gyp\\lib\\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:180:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command \"C:\\\\Program Files\\\
odejs\\\
ode.exe\" \"C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp\\\\bin\\\
ode-gyp.js\" \"rebuild\" \"--verbose\" \"--libsass_ext=\" \"--libsass_cflags=\" \"--libsass_ldflags=\" \"--libsass_library=\"
gyp ERR! cwd C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-sass
gyp ERR! node -v v9.10.1
gyp ERR! node-gyp -v v3.6.2
warning Error running install script for optional dependency: "C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli: Command failed.
Exit code: 1
Command: C:\\windows\\system32\\cmd.exe
Arguments: /d /s /c node-pre-gyp install --fallback-to-build
Directory: C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.36
node-pre-gyp info using node@9.10.1 | win32 | x64
node-pre-gyp info check checked for \"C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli\\lib\\binding\
ode-v59-win32-x64\\zopfli.node\" (not found)
node-pre-gyp http GET https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v59-win32-x64.tar.gz
node-pre-gyp http 403 https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v59-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v59-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@9.10.1 (node-v59 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v59-win32-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@9.10.1 | win32 | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@9.10.1 | win32 | x64
gyp info spawn C:\\Python27\\python.exe
gyp info spawn args [ 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-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 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-zopfli\\\\build\\\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp\\\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Users\\\\Chloe\\\\.node-gyp\\\\9.10.1\\\\include\\\
ode\\\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\\\Users\\\\Chloe\\\\.node-gyp\\\\9.10.1',
gyp info spawn args '-Dnode_gyp_dir=C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Chloe\\\\.node-gyp\\\\9.10.1\\\\<(target_arch)\\\
ode.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-zopfli',
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 'C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-zopfli\\\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@9.10.1 | win32 | x64
gyp info spawn C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.
MSBUILD : error MSB3411: Could not load the Visual C++ component \"VCBuild.exe\". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server
2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008. [C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli\\build\\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-gyp\\lib\\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:180:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command \"C:\\\\Program Files\\\
odejs\\\
ode.exe\" \"C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-gyp\\\\bin\\\
ode-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-zopfli\\\\lib\\\\binding\\\
ode-v59-win32-x64\\\\zopfli.node\" \"--module_name=zopfli\" \"--module_path=C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-zopfli\\\\lib\\\\binding\\\
ode-v59-win32-x64\"
gyp ERR! cwd C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli
gyp ERR! node -v v9.10.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\\Program Files\
odejs\
ode.exe C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-gyp\\bin\
ode-gyp.js build --fallback-to-build --module=C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli\\lib\\binding\
ode-v59-win32-x64\\zopfli.node --module_name=zopfli --module_path=C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli\\lib\\binding\
ode-v59-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-pre-gyp\\lib\\util\\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command \"C:\\\\Program Files\\\
odejs\\\
ode.exe\" \"C:\\\\Users\\\\Chloe\\\\workspace\\\\catalyst_research\\\
ode_modules\\\
ode-pre-gyp\\\\bin\\\
ode-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli
node-pre-gyp ERR! node -v v9.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute 'C:\\Program Files\
odejs\
ode.exe C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-gyp\\bin\
ode-gyp.js build --fallback-to-build --module=C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli\\lib\\binding\
ode-v59-win32-x64\\zopfli.node --module_name=zopfli --module_path=C:\\Users\\Chloe\\workspace\\catalyst_research\
ode_modules\
ode-zopfli\\lib\\binding\
ode-v59-win32-x64' (1)"
info This module is OPTIONAL, you can safely ignore this error
答案 0 :(得分:0)
尝试以下步骤。
node_modules
文件夹和package-lock.json
npm install --global windows-build-tools
node modules
重新安装 npm install