Errors with diskusage and sharp modules
bhanuuday opened this issue · 4 comments
bhanuuday commented
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
subnub commented
Hello,
This is usually caused by missing visual c++ and the python 2 packages.
This seems to be a common issue on windows, without these two things.
Here is the link to the c++ package:
http://go.microsoft.com/fwlink/?LinkId=691126
…On Tue, Mar 10, 2020, 8:36 AM bhanuuday ***@***.***> wrote:
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! ***@***.*** 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 ***@***.*** 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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5?email_source=notifications&email_token=AKUOAK4YJL7BL52KISMTJU3RGYX6VA5CNFSM4LE55372YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IT36UBQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKUOAK3T5DZKHQ6RHOOUAZDRGYX6VANCNFSM4LE5537Q>
.
bhanuuday commented
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.```
subnub commented
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.
subnub commented
Please reopen this if the issue has not been resolved.