subnub/myDrive

Errors with diskusage and sharp modules

bhanuuday opened this issue · 4 comments

used command npm install but getting errors, first with "diskusage" dependency "node-gyp" and after somehow getting around it I got an error with the "sharp" module after googling and trying a lot I couldn't get around this error.

Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp.node'
Require stack:
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\node_modules\sharp\lib\constructor.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\node_modules\sharp\lib\index.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\services\FileService\utils\createThumbnail.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\services\FileService\index.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\controllers\file.js 
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\express-routers\file.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\server\server.js        
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\server\serverStart.js   

- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/    
- Search for this error at https://github.com/lovell/sharp/issues

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-drive@1.0.0 start: `cross-env NODE_ENV=production env-cmd -f ./config/prod.env node server/serverStart.js --env production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-drive@1.0.0 start 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\Bhanu\AppData\Roaming\npm-cache\_logs\2020-03-10T12_30_52_622Z-debug.log   

Thanks for the quick reply, I have installed them already and to be sure I have tried installing them again, but still I am getting error.

(node:15824) UnhandledPromiseRejectionWarning: Error: Cannot find module './build/Release/diskusage.node'
Require stack:
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\node_modules\diskusage\index.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\controllers\storage.js     
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\express-routers\storage.js 
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\server\server.js
- D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\server\serverStart.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:954:17)
    at Function.Module._load (internal/modules/cjs/loader.js:847:27)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18)
    at Object.<anonymous> (D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\node_modules\diskusage\index.js:1:14)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
    at Module.load (internal/modules/cjs/loader.js:976:32)
    at Function.Module._load (internal/modules/cjs/loader.js:884:14)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18)
    at Object.<anonymous> (D:\My Data\Programming\Important Now\Javascript\Practice\myDrive-master\src\controllers\storage.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
    at Module.load (internal/modules/cjs/loader.js:976:32)
    at Function.Module._load (internal/modules/cjs/loader.js:884:14)
(node:15824) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the 
Node.js process with a non-zero exit code.```

It looks like you do not have the diskusage module, have you tried deleting your node modules folder (located in the root of the project under "node_modules"), and reinstalling? It looks like npm install did not finish completely.

Please reopen this if the issue has not been resolved.