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

Can't install drivelist #367

Open DamienDoumer opened 4 years ago

DamienDoumer commented 4 years ago

I have an electron project in which drivelist is used as a dependency. When I run "npm install", I get an error stating node-gyp\bin folder wasn't found. Whereas, I have node-gyp\bin in my node modules, and even in c:\programfiles\nodejs ...." as opposed to what this error states. I guess drivelist couldn't build from source code after installation. But, what is the walk arround ? I am stuck because of this.

drivelist@8.0.10 install C:\Users...\node_modules\drivelist prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.17.0 runtime=node arch=x64 libc= platform=win32)

C:\Users...\node_modules\drivelist>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin" rebuild ) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) npm WARN repoApp-explorer@3.1.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! drivelist@8.0.10 install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the drivelist@8.0.10 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2020-03-27T15_58_03_598Z-debug.log

In your readme, I didn't find a means to build the package manually and adding it as a dependency. Please is there a work arround ?

lurch commented 4 years ago

Possibly related to #331 ? :man_shrugging:

DamienDoumer commented 4 years ago

Hi @lurch I'm running the above command on windows, it might be related though. I also get this error:

prebuild-install http 404 https://github.com/balena-io-modules/drivelist/releases/download/v8.0.10/drivelist-v8.0.10-electron-v76-win32-x64.tar.gz

lurch commented 4 years ago

I've got no idea if this is related to your problem or not (I don't use Windows, and I don't work on drivelist - I'm merely a "passing observer") but the fact that node_modules appears 3 times in "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" looks a bit weird? :man_shrugging: (or it might just be that's how npm works on Windows :man_shrugging: )