You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref is used in my project as a dependency to net-keepalive.
On my develop machine everything is fine... but when i deploy to target machine (same x64 architecture of develop machine, and same node version, but different OS version; i use archilinux on the develop machine) node exits with:
//----
TypeError: Cannot assign to read only property 'name' of object '[object Object]'
at Object.refType (/home/hemosafe2/robot/node_modules/net-keepalive/node_modules/ref/lib/ref.js:309:14)
at Object. (/home/hemosafe2/robot/node_modules/net-keepalive/node_modules/ffi/lib/type.js:22:42)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/hemosafe2/robot/node_modules/net-keepalive/node_modules/ffi/lib/cif.js:6:12)
//----
ref is used in my project as a dependency to net-keepalive.
On my develop machine everything is fine... but when i deploy to target machine (same x64 architecture of develop machine, and same node version, but different OS version; i use archilinux on the develop machine) node exits with:
//----
TypeError: Cannot assign to read only property 'name' of object '[object Object]'
at Object.refType (/home/hemosafe2/robot/node_modules/net-keepalive/node_modules/ref/lib/ref.js:309:14)
at Object. (/home/hemosafe2/robot/node_modules/net-keepalive/node_modules/ffi/lib/type.js:22:42)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/hemosafe2/robot/node_modules/net-keepalive/node_modules/ffi/lib/cif.js:6:12)
//----
i'm too noob in javascrpt and absolutely not able to understand this error; but searched on Stackoverflow and found this https://stackoverflow.com/questions/44288164/cannot-assign-to-read-only-property-name-of-object-object-object
so i tried this fix, and seems it worked:
in node_modules/net-keepalive/node_modules/ref/lib/ref.js :
exports.refType = function refType (type) {
var _type = exports.coerceType(type)
var rtn = Object.create(_type)
rtn.indirection++
if (_type.name) {
- rtn.name = _type.name + ''
+ Object.defineProperty(rtn, 'name', {
+ writable: true,
+ value: _type.name + ''
+ });
}
return rtn
}
The text was updated successfully, but these errors were encountered: