question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows 8: A dynamic link library (DLL) initialization routine failed.

See original GitHub issue

Hi, I’m getting the following error:

Something went wrong installing the "sharp" module

A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\build\Release\sharp.node

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose sharp" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

    at Object.<anonymous> (C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\lib\constructor.js:32:9)
    at Module._compile (node:internal/modules/cjs/loader:1133:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1168:10)
    at Module.load (node:internal/modules/cjs/loader:1013:32)
    at Function.Module._load (node:internal/modules/cjs/loader:853:14)
    at Module.require (node:internal/modules/cjs/loader:1037:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\lib\index.js:3:15)
    at Module._compile (node:internal/modules/cjs/loader:1133:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1168:10)

Deleting node_modules/sharp and running this command doesn’t help.

Did you see the documentation relating to installation? Yes

Have you ensured the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime? Yes

Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest? Yes

If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag? Yes

What is the complete output of running npm install --verbose sharp? Have you checked this output for useful error messages?

npm info it worked if it ends with ok
npm verb cli [
npm verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   '--verbose',
npm verb cli   'sharp'
npm verb cli ]
npm info using npm@6.14.13
npm info using node@v14.17.3
npm verb npm-session 2879f16abe460b37
npm http fetch GET 304 https://registry.npmjs.org/sharp 333ms (from cache)
npm timing stage:loadCurrentTree Completed in 563ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 99ms
npm http fetch GET 304 https://registry.npmjs.org/color 101ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/node-addon-api 217ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tunnel-agent 268ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/prebuild-install 283ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/detect-libc 294ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-get 295ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-fs 296ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/semver 305ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-string 88ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-convert 91ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-name 64ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-swizzle 75ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/is-arrayish 83ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/npmlog 121ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/napi-build-utils 127ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/github-from-package 131ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minimist 132ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/node-abi 134ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/expand-template 142ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/rc 138ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pump 155ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mkdirp-classic 181ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/gauge 88ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/console-control-strings 91ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/set-blocking 93ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/are-we-there-yet 98ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/delegates 83ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/readable-stream 87ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/core-util-is 94ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/process-nextick-args 150ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/inherits 153ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/util-deprecate 158ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/string_decoder 160ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/isarray 162ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/safe-buffer 163ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/signal-exit 125ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/object-assign 132ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/has-unicode 134ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/wide-align 132ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/aproba 142ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/strip-ansi 142ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/string-width 145ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/code-point-at 67ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/is-fullwidth-code-point 80ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/number-is-nan 76ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ansi-regex 65ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/end-of-stream 118ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/once 123ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/wrappy 114ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/deep-extend 457ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/strip-json-comments 458ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ini 462ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/decompress-response 190ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-concat 192ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mimic-response 151ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/chownr 70ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-stream 79ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/bl 66ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs-constants 90ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/buffer 84ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ieee754 71ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/base64-js 77ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/lru-cache 80ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/yallist 67ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 3226ms
npm timing stage:loadIdealTree Completed in 3370ms
npm timing stage:generateActionsToTake Completed in 52ms
npm verb correctMkdir C:\Users\Admin\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb makeCacheDir UID & GID are irrelevant on win32
npm verb lock using C:\Users\Admin\AppData\Roaming\npm-cache\_locks\staging-2701d07c72aea026.lock for C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\.staging
npm timing audit submit Completed in 564ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 564ms
npm timing audit body Completed in 4ms
npm timing action:extract Completed in 570ms
npm info lifecycle sharp@0.28.3~preuninstall: sharp@0.28.3
npm info lifecycle sharp@0.28.3~uninstall: sharp@0.28.3
npm verb unbuild rmStuff sharp@0.28.3 from C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules
npm info lifecycle sharp@0.28.3~postuninstall: sharp@0.28.3
npm timing action:unbuild Completed in 8ms
npm timing action:remove Completed in 291ms
npm timing action:finalize Completed in 3ms
npm timing action:refresh-package-json Completed in 10ms
npm info lifecycle sharp@0.28.3~preinstall: sharp@0.28.3
npm timing action:preinstall Completed in 2ms
npm info linkStuff sharp@0.28.3
npm timing action:build Completed in 2ms
npm info lifecycle sharp@0.28.3~install: sharp@0.28.3

> sharp@0.28.3 install C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Using cached C:\Users\Admin\AppData\Roaming\npm-cache\_libvips\libvips-8.10.6-win32-x64.tar.br
sharp: Creating C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\build\Release
sharp: Copying DLLs from C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\vendor\8.10.6\lib to C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\build\Release
prebuild-install info begin Prebuild-install version 6.1.3
prebuild-install info looking for local prebuild @ prebuilds\sharp-v0.28.3-napi-v3-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\Admin\AppData\Roaming\npm-cache\_prebuilds\da1c59-sharp-v0.28.3-napi-v3-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\Admin\AppData\Roaming\npm-cache\_prebuilds\da1c59-sharp-v0.28.3-napi-v3-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\build\Release\sharp.node
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle sharp@0.28.3~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.28.3~install: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp\node_modules\.bin;C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\.bin;C:\Program Files\7-Zip\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\adb;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\Admin\.cargo\bin;C:\Users\Admin\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\Admin\AppData\Local\Programs\Python\Python39\;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.1\bin;;C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Admin\AppData\Roaming\npm
npm verb lifecycle sharp@0.28.3~install: CWD: C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\sharp
npm timing action:install Completed in 2969ms
npm info lifecycle sharp@0.28.3~postinstall: sharp@0.28.3
npm timing action:postinstall Completed in 2ms
npm verb unlock done using C:\Users\Admin\AppData\Roaming\npm-cache\_locks\staging-2701d07c72aea026.lock for C:\Users\Admin\Desktop\Projects\fiszki\src\node_modules\.staging
npm timing stage:executeActions Completed in 3897ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 7935ms
npm verb saving [ { name: 'sharp', spec: '^0.28.3', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle fiszki@1.0.0~shrinkwrap: fiszki@1.0.0
npm verb shrinkwrap skipping write for package-lock.json because there were no changes.
npm info lifecycle fiszki@1.0.0~postshrinkwrap: fiszki@1.0.0
+ sharp@0.28.3
updated 1 package and audited 68 packages in 8.03s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm verb exit [ 0, true ]
npm timing npm Completed in 8629ms
npm info ok

and yes.

What is the output of running npx envinfo --binaries --system?

System:
    OS: Windows 8.1 6.3.9600
    CPU: (4) x64 Intel(R) Core(TM) i5-4310M CPU @ 2.70GHz
    Memory: 4.52 GB / 7.91 GB
  Binaries:
    Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Jul 19, 2021

If Dependency Walker can’t find anything wrong with the sharp.node file (which is a DLL) on its own then the problem is likely to be due to the way NW.js is loading DLLs. I’ll see if I can find a Windows machine to try to reproduce.

0reactions
lovellcommented, Oct 22, 2022

There’s a more modern and up-to-date tool for debugging DLL problems at https://github.com/lucasg/Dependencies but otherwise I’m going to close this issue due to lack of updates. Please feel free to reopen if more information is available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A dynamic link library (DLL) initialization routine failed
Using Windows 7. Within the last 2 days, every time I use my right button (shortcut) on my mouse, I get a DLL...
Read more >
A dynamic link library (DLL) initialization routine failed #5940
System information OS Windows 10 x64 TensorFlow.js installed from npm i ... A dynamic link library (DLL) initialization routine failed #5940.
Read more >
liferaysass.dll : A dynamic link library initialization routine failed
I'm migrating to a new Windows Server 2016 build server and running into gradlew build errors when it tries to compile the first...
Read more >
Trying to use win32ui with pywin32 gives: A dynamic link ...
_name, mode) OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed >>> import win32api.
Read more >
1114: A dynamic link library (DLL) initialization routine failed
A) Microsoft has updated the JET driver likely because of a security or performance issue. They have likely deprecated a function or changed ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found