Я пытаюсь развернуть мой Angular универсальный проект в firebase, но это не удалось из-за sharp.node
.
Я получил следующую ошибку:
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)
Вы можете подробности см. здесь здесь
мои настройки веб-пакета:
externals: {
"./dist/server/main": 'require("./server/main")'
}
module : {
rules: [
{
test: /\.node$/,
use: "node-loader"
}
]
}
Я добавил sharp
к externals
externals: {
'sharp': 'commonjs2 sharp',
"./dist/server/main": 'require("./server/main")'
}
но я получил следующую ошибку:
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)