node-gyp
node-gyp copied to clipboard
“node-gyp rebuild” throw an error MSB4018: “The "AssignTargetPath" task failed unexpectedly”
I got a problem when running node-gyp rebuild. Run it as administrator has the same problem. Please help me to fix it.
-
Node Version:
v14.20.0 - Platform: Windows 10 Home
- Compiler: “Microsoft Visual Studio Community 2022” x64 with C++ build tools
- Module: my project
-
Python:
3.10.7
Task AssignTargetPath code from Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5)
<AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_NoneWithTargetPath" />
</AssignTargetPath>
Verbose output (from node-gyp):
node-gyp rebuild --verbose
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Program Files\\nodejs\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose'
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python checking Python explicitly set from environment variable PYTHON
gyp verb find Python - process.env.PYTHON is "C:\Python27\"
gyp verb find Python - executing "C:\Python27\" to get executable path
gyp verb find Python - "C:\Python27\" is not in PATH or produced an error
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - "python3" is not in PATH or produced an error
gyp verb find Python checking if "python" can be used
gyp verb find Python - executing "python" to get executable path
gyp verb find Python - "python" is not in PATH or produced an error
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python39\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python39\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python39\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python39\python.exe
gyp verb find Python - executing "C:\Program Files\Python39\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python39\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python39-32\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python39-32\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python39-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python39-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python39-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python39-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python38\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python38\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python38\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python38\python.exe
gyp verb find Python - executing "C:\Program Files\Python38\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python38\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python38-32\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python38-32\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python38-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python38-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python38-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python38-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python37\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python37\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python37\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python37\python.exe
gyp verb find Python - executing "C:\Program Files\Python37\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python37\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python37-32\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python37-32\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python37-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python37-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python37-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python37-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python36\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python36\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python36\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python36\python.exe
gyp verb find Python - executing "C:\Program Files\Python36\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python36\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python36-32\python.exe
gyp verb find Python - executing "C:\Users\User\AppData\Local\Programs\Python\Python36-32\python.exe" to get version
gyp verb find Python - "C:\Users\User\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python36-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python36-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python36-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python36-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
gyp verb find Python checking if the py launcher can be used to find Python 3
gyp verb find Python - executing "py.exe" to get Python 3 executable path
gyp verb find Python - executable path is "C:\Python310\python.exe"
gyp verb find Python - executing "C:\Python310\python.exe" to get version
gyp verb find Python - version is "3.10.7"
gyp info find Python using Python version 3.10.7 found at "C:\Python310\python.exe"
gyp verb get node dir no --target version specified, falling back to host node version: 14.20.0
gyp verb command install [ '14.20.0' ]
gyp verb install input version string "14.20.0"
gyp verb install installing version: 14.20.0
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: 14.20.0
gyp verb build dir attempting to create "build" dir: D:\dev\web-chat-core\build
gyp verb build dir "build" dir needed to be created? Yes
gyp verb find VS msvs_version not set from command line or npm config
gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp verb find VS checking VS2022 (17.3.32922.545) found at:
gyp verb find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp verb find VS - found "Visual Studio C++ core features"
gyp verb find VS - found VC++ toolset: v143
gyp verb find VS - found Windows SDK: 10.0.19041.0
gyp info find VS using VS2022 (17.3.32922.545) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: D:\dev\web-chat-core\build\config.gypi
gyp verb config.gypi checking for gypi file: D:\dev\web-chat-core\config.gypi
gyp verb common.gypi checking for gypi file: D:\dev\web-chat-core\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python310\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\User\\AppData\\Roaming\\nvm\\v14.20.0\\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 '-I',
gyp info spawn args 'D:\\dev\\web-chat-core\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\User\\AppData\\Roaming\\nvm\\v14.20.0\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\14.20.0\\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\\User\\AppData\\Local\\node-gyp\\Cache\\14.20.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\User\\AppData\\Roaming\\nvm\\v14.20.0\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.20.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\\dev\\web-chat-core',
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:\\dev\\web-chat-core\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0
gyp verb found first Solution file build/binding.sln
gyp verb using MSBuild: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
Выполняется последовательная сборка проектов в этом решении. Чтобы включить параллельную сборку, добавьте параметр "-m".
Сборка начата 07.10.2022 4:29:22.
Проект "D:\dev\web-chat-core\build\binding.sln" в узле 1 (целевые объекты по умолчанию).
ValidateSolutionConfiguration:
Создание конфигурации решения "Release|x64".
Проект "D:\dev\web-chat-core\build\binding.sln" (1) выполняет сборку "D:\dev\web-chat-core\build\binding.vcxproj" (2) в узле 1 (целевые объекты по умолчанию).
PrepareForBuild:
Создание каталога "Release\obj\binding\".
Создание каталога "Release\obj\binding\binding.tlog\".
InitializeBuildStatus:
Создание "Release\obj\binding\binding.tlog\unsuccessfulbuild", так как было задано "AlwaysCreate".
ClCompile:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\CL.exe /c /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\include\node" /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\src" /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\deps\openssl\config" /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\deps\openssl\openssl\include" /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\deps\uv\include" /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\deps\zlib" /I"C:\Users\User\AppData\Local\node-gyp\Cache\14.20.0\deps\v8\include" /Z7 /nologo /W3 /WX- /diagnostics:column /MP /Ox /Ob2 /Oi /Ot /Oy /GL /D NODE_GYP_MODULE_NAME=binding /D USING_UV_SHARED=1 /D USING_V8_SHARED=1 /D V8_DEPRECATION_WARNINGS=1 /D V8_DEPRECATION_WARNINGS /D V8_IMMINENT_DEPRECATION_WARNINGS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0 /D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D BUILDING_NODE_EXTENSION /D "HOST_BINARY=\"node.exe\"" /D _WINDLL /GF /Gm- /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Fo"Release\obj\binding\\" /Fd"Release\obj\binding\vc143.pdb" /external:W3 /Gd /TP /wd4351 /wd4355 /wd4800 /wd4251 /wd4275 /wd4244 /wd4267 /FC /errorReport:queue "C:\Users\User\AppData\Roaming\nvm\v14.20.0\node_modules\node-gyp\src\win_delay_load_hook.cc"
win_delay_load_hook.cc
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: непредвиденная ошибка при выполнении задачи "AssignTargetPath". [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: System.NotSupportedException: Данный формат пути не поддерживается. [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в Microsoft.Build.Tasks.AssignTargetPath.Execute() [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [D:\dev\web-chat-core\build\binding.vcxproj]
Сборка проекта "D:\dev\web-chat-core\build\binding.vcxproj" завершена (целевые объекты по умолчанию) с ошибкой.
Сборка проекта "D:\dev\web-chat-core\build\binding.sln" завершена (целевые объекты по умолчанию) с ошибкой.
Ошибка сборки.
"D:\dev\web-chat-core\build\binding.sln" (целевой объект по умолчанию) (1) ->
"D:\dev\web-chat-core\build\binding.vcxproj" (целевой объект по умолчанию) (2) ->
(Целевой объект AssignTargetPaths) ->
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: непредвиденная ошибка при выполнении задачи "AssignTargetPath". [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: System.NotSupportedException: Данный формат пути не поддерживается. [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в Microsoft.Build.Tasks.AssignTargetPath.Execute() [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\dev\web-chat-core\build\binding.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3061,5): error MSB4018: в Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [D:\dev\web-chat-core\build\binding.vcxproj]
Предупреждений: 0
Ошибок: 1
Прошло времени 00:00:00.79
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\User\AppData\Roaming\nvm\v14.20.0\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose"
gyp ERR! cwd D:\dev\web-chat-core
gyp ERR! node -v v14.20.0
gyp ERR! node-gyp -v v9.2.0
gyp ERR! not ok