nodejs安装sharp出错的问题

PS D:\report\source\lpd-planning-allocation> yarn
yarn install v1.3.2
[1/4] Resolving packages...
[2/4] 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.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/2] ⠄ dtrace-provider
[2/2] ⠄ sharp: C:\Users\chenwes\.node-gyp\8.9.4\x64\node.lib : fatal error LNK1127: ������ [D:\report\esquel\lpd-planning-allocation\node_modules\sharp\build\sharp.vcxproj]
[-/2] ⠄ waiting...
[-/2] ⠄ waiting...
error D:\report\source\lpd-planning-allocation\node_modules\sharp: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: D:\report\esquel\lpd-planning-allocation\node_modules\sharp
Output:
D:\report\source\lpd-planning-allocation\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.9.4 | win32 | x64
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'C:\\Users\\chenwes\\AppData\\Roaming\\nvm\\v8.9.4\\node_modules\\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   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\report\\esquel\\lpd-planning-allocation\\node_modules\\sharp\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\chenwes\\AppData\\Roaming\\nvm\\v8.9.4\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\chenwes\\.node-gyp\\8.9.4\\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\\chenwes\\.node-gyp\\8.9.4',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\chenwes\\AppData\\Roaming\\nvm\\v8.9.4\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\chenwes\\.node-gyp\\8.9.4\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\report\\esquel\\lpd-planning-allocation\\node_modules\\sharp',
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:\\report\\esquel\\lpd-planning-allocation\\node_modules\\sharp\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\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' ]
�ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ�����ӡ�/m�����ء�
  VError.cpp
  VInterpolate.cpp
  VImage.cpp
  win_delay_load_hook.cc
    ���ڴ����� D:\report\esquel\lpd-planning-allocation\node_modules\sharp\build\Release\libvips-cpp.lib �Ͷ��� D:\report\esquel\lpd-planning-allocation\node_modules\sharp\build\Release\libvips-cpp.exp
  �������ɴ���
  ����ɴ��������
  libvips-cpp.vcxproj -> D:\report\esquel\lpd-planning-allocation\node_modules\sharp\build\Release\\libvips-cpp.dll
  common.cc
  metadata.cc
  operations.cc
  pipeline.cc
  sharp.cc
  utilities.cc
  win_delay_load_hook.cc
C:\Users\chenwes\.node-gyp\8.9.4\x64\node.lib : fatal error LNK1127: ������ [D:\report\esquel\lpd-planning-allocation\node_modules\sharp\build\sharp.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\chenwes\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\report\source\lpd-planning-allocation\node_modules\sharp

 

--python switch to point to Python >= v2.5.0 & < 3.0.0.

python版本有要求

yarn config set python C:\Python27\python.exe

装了2.7  设置一下  就可以了

 

 

 

 

 

 

 

 

 

 

 

posted @ 2018-05-10 11:13  WesChan  阅读(11609)  评论(0编辑  收藏  举报