您好我正在尝试使用memwatch来跟踪 Angular SSR 的内存。在 Angular 的新ng new
命令上,13.0.0
我正在运行我认为在文件node-gyp
中使用时会出现的问题。import * as memwatch from '@airbnb/node-memwatch';
server.ts
该npm run dev:ssr
命令(从ng add @nguniversal/express-engine
( link ) 生成)使用 memwatch 创建以下错误:
/Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:490
throw err;
^
Error: Could not locate the bindings file. Tried:
→ /Users/Jonathan002/Desktop/ssr-angular/build/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/build/Debug/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/build/Release/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/out/Debug/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/Debug/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/out/Release/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/Release/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/build/default/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/compiled/17.2.0/darwin/arm64/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/addon-build/release/install-root/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/addon-build/debug/install-root/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/addon-build/default/install-root/memwatch.node
→ /Users/Jonathan002/Desktop/ssr-angular/lib/binding/node-v102-darwin-arm64/memwatch.node
at bindings (/Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:481:9)
at Object.54614 (/Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:11:51)
at __webpack_require__ (/Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:182375:42)
at /Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:182459:79
at /Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:182522:3
at Object.<anonymous> (/Users/Jonathan002/Desktop/ssr-angular/dist/ssr-angular/server/main.js:182527:12)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
tries: [
'/Users/Jonathan002/Desktop/ssr-angular/build/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/build/Debug/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/build/Release/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/out/Debug/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/Debug/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/out/Release/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/Release/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/build/default/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/compiled/17.2.0/darwin/arm64/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/addon-build/release/install-root/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/addon-build/debug/install-root/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/addon-build/default/install-root/memwatch.node',
'/Users/Jonathan002/Desktop/ssr-angular/lib/binding/node-v102-darwin-arm64/memwatch.node'
]
}
Node.js v17.2.0
A server error has occurred.
node exited with 1 code.
connect ECONNREFUSED ::1:53335
有人知道用@airbnb/node-memwatch
包解决 Angular SSR 的方法吗?可能是版本问题node-gyp
(此处建议:错误:找不到绑定文件。尝试:#56)