balena-io-modules / drivelist

List all connected drives in your computer, in all major operating systems
Apache License 2.0
239 stars 90 forks source link

Drivelist Error: npm install - Cannot find module 'object-assign' - node-gyp #404

Open goldingdamien opened 2 years ago

goldingdamien commented 2 years ago

Installing drivelist is giving me the error below. Is there a fix for this?

Environment: Windows 11 Node.js v16.16.0

Error:

npm ERR! code 1
npm ERR! path **\node_modules\drivelist
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --runtime napi || node-gyp rebuild
npm ERR! prebuild-install warn install No prebuilt binaries found (target=3 runtime=napi arch=x64 libc= platform=win32)
npm ERR! node:internal/modules/cjs/loader:936
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module 'object-assign'
npm ERR! Require stack:
npm ERR! - C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\node_modules\gauge\render-template.js
npm ERR! - C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\node_modules\gauge\plumbing.js
npm ERR! - C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\node_modules\gauge\index.js
npm ERR! - C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\node_modules\npmlog\log.js
npm ERR! - C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\node-gyp.js
npm ERR! - C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:102:18)
npm ERR!     at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\node_modules\gauge\render-template.js:4:20)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1105:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1005:19) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\gauge\\render-template.js',
npm ERR!     'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\gauge\\plumbing.js',
npm ERR!     'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\gauge\\index.js',
npm ERR!     'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\npmlog\\log.js',
npm ERR!     'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\node-gyp.js',
npm ERR!     'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js'
npm ERR!   ]
npm ERR! }
zwhitchcox commented 2 years ago

Hi, sorry, I have been sick and not able to reply to you, but in the meantime, you can try just

npm install object-assign

I'm not exactly sure why this is necessary for you, but I will look into it when I am back.