Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can use sharp in lambda function (OS: window10 , severless) #1671

Closed
kunka7 opened this issue Apr 26, 2019 · 11 comments
Closed

how can use sharp in lambda function (OS: window10 , severless) #1671

kunka7 opened this issue Apr 26, 2019 · 11 comments
Labels

Comments

@kunka7
Copy link

kunka7 commented Apr 26, 2019

module initialization error: Error
at Object.hasVendoredLibvips (/var/task/node_modules/sharp/lib/libvips.js:61:13)
at Object.<anonymous> (/var/task/node_modules/sharp/lib/constructor.js:9:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/task/node_modules/sharp/lib/index.js:3:15)

how can fix this error?
im already try this http://sharp.pixelplumbing.com/en/stable/install/#aws-lambda
and failed

info sharp Using cached C:\Users\kimjs\AppData\Roaming\npm-cache\_libvips\libvips-8.7.4-linux-x64.tar.gz
ERR! sharp EPERM: operation not permitted, symlink 'libpng16\pnglibconf.h' -> 'C:\Users\kimjs\OneDrive\바탕 화면\picpledynamo\dynamo\node_modules\sharp\vendor\include\pnglibconf.h'
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies

C:\Users\kimjs\OneDrive\바탕 화면\picpledynamo\dynamo\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
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 C:\Users\kimjs\OneDrive\바탕 화면\picpledynamo\dynamo\node_modules\sharp
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN dynamo@1.0.0 No description
npm WARN dynamo@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.22.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kimjs\AppData\Roaming\npm-cache\_logs\2019-04-26T07_20_14_387Z-debug.log
@lovell
Copy link
Owner

lovell commented Apr 26, 2019

Hi, the EPERM: operation not permitted, symlink message suggests you're installing to a FAT32 drive/folder, which doesn't support symlinks.

Did you try the Docker-based approach? https://sharp.pixelplumbing.com/en/stable/install/#aws-lambda

@kunka7
Copy link
Author

kunka7 commented Apr 26, 2019

is docker work in window?

@lovell
Copy link
Owner

lovell commented Apr 26, 2019

@kunka7
Copy link
Author

kunka7 commented May 7, 2019

i solved cmd need root access

@djou-13
Copy link

djou-13 commented Aug 25, 2020

i solved cmd need root access

You saved my life :-)

@Tiffastic
Copy link

Run the cmd as Admin solved my problem.

@andresmv94
Copy link

In my case was the antivirus !!

@ljmotta
Copy link

ljmotta commented Jan 5, 2024

I've came across this issue while installing the dependencies of my project, and I solved it by adding my user to the Create symbolic links policy.

I'm using Windows 11 Pro:

  • Open the Local Security Policy -> Local Policies -> User Rights Assignment -> Create symbolic links
  • Click into Add User or Group...
  • Click into Advanced...
  • Click into Find Now
  • Search for your user and click all Oks... reboot your Windows.
  • Voilà

@thanhnha121
Copy link

I've came across this issue while installing the dependencies of my project, and I solved it by adding my user to the Create symbolic links policy.

I'm using Windows 11 Pro:

  • Open the Local Security Policy -> Local Policies -> User Rights Assignment -> Create symbolic links
  • Click into Add User or Group...
  • Click into Advanced...
  • Click into Find Now
  • Search for your user and click all Oks... reboot your Windows.
  • Voilà

Worked for me, thanks @ljmotta

@frostbitten
Copy link

I've came across this issue while installing the dependencies of my project, and I solved it by adding my user to the Create symbolic links policy.

I'm using Windows 11 Pro:

  • Open the Local Security Policy -> Local Policies -> User Rights Assignment -> Create symbolic links
  • Click into Add User or Group...
  • Click into Advanced...
  • Click into Find Now
  • Search for your user and click all Oks... reboot your Windows.
  • Voilà

Thank you! I did not want to run things as administrator. This worked for me on Windows 10 HOME. Since I'm not on PRO, I had to enable the gpedit.msc feature with this (thankfully human-readable) copypasta: https://gist.github.com/lelegard/8da0b20cc35708852c14fcf899651204

@lovell
Copy link
Owner

lovell commented Jan 25, 2024

The method of installation for prebuilt binaries has changed completely from sharp v0.33.0+ and this problem should go away entirely - more details at #3750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants