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

cannot deploy to firebase due to sharp.node #849

Closed
its-dibo opened this issue Apr 16, 2020 · 2 comments
Closed

cannot deploy to firebase due to sharp.node #849

its-dibo opened this issue Apr 16, 2020 · 2 comments

Comments

@its-dibo
Copy link

I'm trying to deploy my Angular universal project to firebase, but it failed due to sharp.node.

I got the following error:

Cannot open node_modules/sharp/build/Release/sharp.node: 

Error: node_modules/sharp/build/Release/sharp.node: cannot open shared object file: No such file or directory

  at Object.<anonymous> (/github/workspace/dist/server.js:4756:551664)
    at __webpack_require__ (/github/workspace/dist/server.js:1:142)
    at Object.<anonymous> (/github/workspace/dist/server.js:4756:550687)
    at __webpack_require__ (/github/workspace/dist/server.js:1:142)
    at Object.<anonymous> (/github/workspace/dist/server.js:4756:549989)
    at __webpack_require__ (/github/workspace/dist/server.js:1:142)
    at Object.<anonymous> (/github/workspace/dist/server.js:3247:71093)
    at __webpack_require__ (/github/workspace/dist/server.js:1:142)
    at Object.<anonymous> (/github/workspace/dist/server.js:3009:1755)
    at __webpack_require__ (/github/workspace/dist/server.js:1:142)
    at /github/workspace/dist/server.js:1:1224
    at Object.<anonymous> (/github/workspace/dist/server.js:1:1271)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

You can see the full details of this from here

my webpack settings:

externals: {
    "./dist/server/main": 'require("./server/main")'
  }


module : {
  rules: [
     {
        test: /\.node$/,
        use: "node-loader"
      }   
  ]
}

I added sharp to externals

 externals: {
    'sharp': 'commonjs2 sharp',
    "./dist/server/main": 'require("./server/main")'
  }

but I got the following error:

Error: Error occurred while parsing your function triggers.

Error: 
Something went wrong installing the "sharp" module

Module did not self-register.

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" 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 Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/github/workspace/dist/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@hiranya911
Copy link
Contributor

This repo is only for Firebase Admin Node.js SDK related issues. Your question seems to be related to the JS SDK and Firebase Hosting service. Try asking in StackOverflow, and if that doesn't help contact support.

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

No branches or pull requests

3 participants