VS CODE下 无法执行 node-gyp 命令
生活随笔
收集整理的這篇文章主要介紹了
VS CODE下 无法执行 node-gyp 命令
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
錯(cuò)誤信息
node-gyp : 無(wú)法加載文件 C:\Users\ThinkPad\AppData\Roaming\npm\node-gyp.ps1,因?yàn)樵诖讼到y(tǒng)上禁止運(yùn)行腳本。有關(guān)詳細(xì)信息, 請(qǐng)參閱 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符: 1 + node-gyp rebuild + ~~~~~~~~+ CategoryInfo : SecurityError: (:) [],PSSecurityException+ FullyQualifiedErrorId : UnauthorizedAccess解決方法
1、管理員運(yùn)行VSCode
2、以管理員運(yùn)行PowerShell,輸入set-ExecutionPolicy RemoteSigned,按Y確認(rèn)即可。
PS D:\work\razer\Anne\node-ffi-napi-master> set-ExecutionPolicy RemoteSigned執(zhí)行策略更改 執(zhí)行策略可幫助你防止執(zhí)行不信任的腳本。更改執(zhí)行策略可能會(huì)產(chǎn)生安全風(fēng)險(xiǎn),如 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies 幫助主題所述。是否要更改執(zhí)行策略? [Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暫停(S) [?] 幫助 (默認(rèn)值為“N”): Y PS D:\work\razer\Anne\node-ffi-napi-master> node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@9.0.0 gyp info using node@16.14.2 | win32 | x64 gyp info find Python using Python version 3.10.3 found at "C:\Python\python.exe" gyp info find VS using VS2019 (16.11.31729.503) found at: gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" gyp info find VS run with --verbose for detailed information gyp info spawn C:\Python\python.exe gyp info spawn args [ gyp info spawn args 'C:\\Users\\ThinkPad\\AppData\\Roaming\\npm\\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:\\work\\razer\\Anne\\node-ffi-napi-master\\build\\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Users\\ThinkPad\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Users\\ThinkPad\\AppData\\Local\\node-gyp\\Cache\\16.14.2\\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\\ThinkPad\\AppData\\Local\\node-gyp\\Cache\\16.14.2', gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\ThinkPad\\AppData\\Roaming\\npm\\node_modules\\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\ThinkPad\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.14.2\\\\<(target_arch)\\\\node.lib', gyp info spawn args '-Dmodule_root_dir=D:\\work\\razer\\Anne\\node-ffi-napi-master', 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\\razer\\Anne\\node-ffi-napi-master\\build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe gyp info spawn args [ 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' gyp info spawn args ] 在此解決方案中一次生成一個(gè)項(xiàng)目。若要啟用并行生成,請(qǐng)?zhí)砑印?m”開關(guān)。Preprocessing assembly file ..\..\..\deps\libffi\src\x86\win64_intel.preasmwin64_intel.preasmBuilding assembly file Release\obj\ffi\\win64_intel.asmAssembling: Release\obj\ffi\win64_intel.asmprep_cif.ctypes.craw_api.cjava_raw_api.cclosures.cffiw64.cwin_delay_load_hook.ccffi.vcxproj -> D:\work\razer\Anne\node-ffi-napi-master\build\Release\\libffi.libnothing.cwin_delay_load_hook.ccnothing.vcxproj -> D:\work\razer\Anne\node-ffi-napi-master\build\Release\\nothing.libffi.cccallback_info.ccthreaded_callback_invokation.ccwin32-dlfcn.ccwin_delay_load_hook.cc正在創(chuàng)建庫(kù) D:\work\razer\Anne\node-ffi-napi-master\build\Release\ffi_bindings.lib 和對(duì)象 D:\work\razer\Anne\node-ffi-napi-master\build\Release\ffi_bindings.exp正在生成代碼Previous IPDB not found, fall back to full compilation.All 523 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.已完成代碼的生成ffi_bindings.vcxproj -> D:\work\razer\Anne\node-ffi-napi-master\build\Release\\ffi_bindings.node gyp info ok總結(jié)
以上是生活随笔為你收集整理的VS CODE下 无法执行 node-gyp 命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 网上找到了一个电机正反转驱动电路,保留
- 下一篇: android:layout_gravi