Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm trying to require sharp for a node web project but I'm getting an error
- PS E:\Computer-Stuff\Javascript\2018\New folder> node .\test.js
- internal/modules/cjs/loader.js:718
- return process.dlopen(module, path.toNamespacedPath(filename));
- ^
- Error: The specified module could not be found.
- \\?\E:\Computer-Stuff\Javascript\2018\New folder\node_modules\sharp\build\Release\sharp.node
- at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
- at Module.load (internal/modules/cjs/loader.js:599:32)
- at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
- at Function.Module._load (internal/modules/cjs/loader.js:530:3)
- at Module.require (internal/modules/cjs/loader.js:637:17)
- at require (internal/modules/cjs/helpers.js:20:18)
- at Object.<anonymous> (E:\Computer-Stuff\Javascript\2018\New folder\node_modules\sharp\lib\constructor.js:10:15)
- at Module._compile (internal/modules/cjs/loader.js:689:30)
- at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
- at Module.load (internal/modules/cjs/loader.js:599:32)
- EnitoniToday at 9:19 PM
- Please show us your code
- dumbloleToday at 9:20 PM
- sure
- index.js
- const testMod = require("sharp");
- console.log("Done!");
- package.json
- {
- "dependencies": {
- "sharp": "^0.20.8"
- }
- }
- EnitoniToday at 9:21 PM
- Did you do npm install ?
- dumbloleToday at 9:21 PM
- yep
- EnitoniToday at 9:21 PM
- Do you have libvips installed?
- dumbloleToday at 9:21 PM
- uh
- EnitoniToday at 9:22 PM
- wait
- hold on
- what version of node are you on?
- dumbloleToday at 9:22 PM
- latest
- EnitoniToday at 9:23 PM
- Okay yeah I think I know what your issue is
- dumbloleToday at 9:23 PM
- C:\Users\Super>node --version
- v10.11.0
- C:\Users\Super>
- EnitoniToday at 9:23 PM
- The specified module could not be found is a windows error
- I think sharp is looking for libvips and isn't finding it
- dumbloleToday at 9:23 PM
- yeah i figured that out
- so should i install it?
- EnitoniToday at 9:23 PM
- Yeah, try that
- dumbloleToday at 9:23 PM
- alright, thanks
- EnitoniToday at 9:23 PM
- I use sharp in my own project, though on linux
- I've never had to install anything which is why I find it strange
- dumbloleToday at 9:24 PM
- whoa that's cool
- didn't know someone else knew about it
- thanks for the help
- EnitoniToday at 9:24 PM
- https://media.wavedistrict.com/images/c40a6f5655ab7ac208ecbdf6022932263e8b06b0e0a5b8cd1.webp?source=webp-512x512
- dumbloleToday at 9:24 PM
- i hope it works
- EnitoniToday at 9:24 PM
- done with sharp
- dumbloleToday at 9:24 PM
- nice
- EnitoniToday at 9:24 PM
- well I'm pretty sure it's the most popular one
- cause I think it's the fastest out of the currently available nodejs image processing libraries
- dumbloleToday at 9:25 PM
- cool
- EnitoniToday at 9:26 PM
- when you install libvips, reinstall sharp too
- dumbloleToday at 9:26 PM
- sure
- oh
- how'd you figure out I was on windows
- ack I still get the same error
- @Enitoni any ideas?
- EnitoniToday at 9:28 PM
- restart cmd
- if you're using that
- or terminate the vscode terminal
- then try again
- dumbloleToday at 9:30 PM
- rip
- did rm ./node_modules
- npm install
- still doesn't work
- EnitoniToday at 9:30 PM
- are you getting an error while installing?(edited)
- iirc sharp uses node-gyp
- dumbloleToday at 9:31 PM
- no errors whiles installing
- EnitoniToday at 9:31 PM
- interesting
- dumbloleToday at 9:31 PM
- do you have teamviewer
- EnitoniToday at 9:31 PM
- No
- Do you have build tools installed?
- https://www.npmjs.com/package/windows-build-tools
- npm
- windows-build-tools
- Install C++ Build Tools for Windows using npm
- dumbloleToday at 9:32 PM
- yes
- i do
- EnitoniToday at 9:32 PM
- Hmm...
- dumbloleToday at 9:32 PM
- i also installed vs community 2017
- EnitoniToday at 9:32 PM
- if you do libvips in cmd
- dumbloleToday at 9:32 PM
- according to this:
- EnitoniToday at 9:32 PM
- does it recognize it
- it's possible it's not in PATH(edited)
- dumbloleToday at 9:32 PM
- https://www.gatsbyjs.org/docs/gatsby-on-windows/
- oh crap
- its not in cmd
- so uh
- i have path open, but what exactly do i put
- into my env variables
- EnitoniToday at 9:34 PM
- hold on
- it's
- vips
- not libvips
- my bad
- dumbloleToday at 9:34 PM
- install vips?
- EnitoniToday at 9:35 PM
- no
- you already installed it
- so do vips in cmd
- if it doesn't appear then it's not in your path
- dumbloleToday at 9:36 PM
- oof
- what exactly do i put into my path
- EnitoniToday at 9:37 PM
- just the directory of where libvips is in
- that should be it(edited)
- dumbloleToday at 9:38 PM
- i installed it locally or does it not work like that
- EnitoniToday at 9:38 PM
- how did you install it
- dumbloleToday at 9:38 PM
- npm install
- should i have done it globally?
- EnitoniToday at 9:39 PM
- wait
- WAIT
- do you have antivirus on your computer
- this might be a permission error actually
- dumbloleToday at 9:39 PM
- i didn't have a permission error when installing
- i will disable it though
- EnitoniToday at 9:40 PM
- Windows permissions are stupid like that
- try disabling it
- and see if it works
- I don't run any antivirus on my computer (yeah I'm crazy lol) so I never run into issues like that(edited)
- only windows defender which does nothing
- dumbloleToday at 9:41 PM
- nothing
- EnitoniToday at 9:41 PM
- Restart your computer
- dumbloleToday at 9:42 PM
- brb
- no success
- heck
- maybe i should ditch windows
- EnitoniToday at 9:44 PM
- okay no
- dumbloleToday at 9:44 PM
- this is pissing me off so much
- EnitoniToday at 9:44 PM
- do
- npm install --verbose sharp(edited)
- dumbloleToday at 9:45 PM
- i have and theres no error
- EnitoniToday at 9:45 PM
- just do it
- and send me a pastebin of the result
- dumbloleToday at 9:45 PM
- https://pastebin.com/Zy1gmaNj
- Pastebin
- PS E:\Computer-Stuff\Javascript\2018\New folder> npm install --ver...
- EnitoniToday at 9:46 PM
- you didn't make that just now
- dumbloleToday at 9:47 PM
- i did
- ?
- did i do something wrong
- EnitoniToday at 9:47 PM
- you may have sent me the wrong pastebin
- this one is old
- dumbloleToday at 9:47 PM
- https://pastebin.com/Zy1gmaNj
- Pastebin
- PS E:\Computer-Stuff\Javascript\2018\New folder> npm install --ver...
- what?
- EnitoniToday at 9:47 PM
- ... that's the same link
- dumbloleToday at 9:48 PM
- it says september 25th
- EnitoniToday at 9:48 PM
- and I told you to do npm install --verbose sharp
- dumbloleToday at 9:48 PM
- oh
- https://pastebin.com/qZTwhmct
- Pastebin
- 9:50 9/25/2018 - Pastebin.com
- i put the date into the title
- thanks for spending your time helping me
- EnitoniToday at 9:53 PM
- so I tried doing this myself
- https://i.imgur.com/1nh65Dn.png
- I'm not sure why it isn't working for you
- are you on w10?
- dumbloleToday at 9:54 PM
- yes
- EnitoniToday at 9:54 PM
- Hmm...
- dumbloleToday at 9:55 PM
- any theories?
- EnitoniToday at 9:56 PM
- I'm looking at where your error spawns from
- const sharp = require('../build/Release/sharp.node');
- this line here
- dumbloleToday at 9:56 PM
- it exists i see it
- EnitoniToday at 9:56 PM
- is where it fails
- dumbloleToday at 9:56 PM
- in my folder
- its in node modules
- EnitoniToday at 9:58 PM
- In that case it has to be libvips
- dumbloleToday at 9:58 PM
- okay, so what should i do
- EnitoniToday at 9:59 PM
- I'm not sure
- This should just be working for you
- like how it worked fine for me
- dumbloleToday at 9:59 PM
- i think its because i'm on windows?
- EnitoniToday at 9:59 PM
- No, because I'm on windows too
- dumbloleToday at 9:59 PM
- is there something i have to do with build tools and my PATH?
- EnitoniToday at 10:00 PM
- It's not your build tools
- if it was, then sharp would not even install
- dumbloleToday at 10:00 PM
- i've tried using dependency walker
- and it comes up with a bunch of errors
- similar to this:
- https://github.com/lovell/sharp/issues/710
- GitHub
- zeit/hyper: Error: The specified module could not be found. · Iss...
- I'm on Windows 10 Pro (x64), build seems to work, but require fails. npm i sharp > [email protected] install D:\Code\novascreen\aspnetcore-spa\node_modules\sharp > node-gyp rebuild D:\Code\nov...
- uh
- should i try uninstalling all the random vs community stuff i have
- EnitoniToday at 10:02 PM
- how are you running your js file
- dumbloleToday at 10:02 PM
- node
- EnitoniToday at 10:02 PM
- no from like
- what terminal
- cmd, powershell?
- dumbloleToday at 10:02 PM
- powershell
- i have a bunch of vs community stuff
- EnitoniToday at 10:03 PM
- it doesn't matter
- that's only for build
- dumbloleToday at 10:03 PM
- okay
- EnitoniToday at 10:03 PM
- I'm sorry, but I'm afraid the only person who can help you is lovell
- dumbloleToday at 10:03 PM
- alright, thanks man
- appreciate it
- EnitoniToday at 10:03 PM
- I have ran out of ideas
- This is very strange
- like I said, it should just be working
- I had no issues setting it up on my windows machine
- dumbloleToday at 10:04 PM
- I agree, because I can't find anything like it on the internet
- for the past 3 days
- EnitoniToday at 10:04 PM
- Yeah, it's... weird
- but anyway
- I gotta crash
- dumbloleToday at 10:04 PM
- bye mate
- EnitoniToday at 10:04 PM
- Goodbye
- dumbloleToday at 10:05 PM
- my computer is custom built tho
- not prebuilt
- and then i installed windows os
- EnitoniToday at 10:05 PM
- so is mine
- dumbloleToday at 10:05 PM
- ah
- well anyways, thanks a lot
- EnitoniToday at 10:06 PM
- Ryzen 5 + Geforce 1060 and 16gb of ram with an B350+ motherboard(edited)
- fully custom built
- so I don't think that's where the issue is
- dumbloleToday at 10:06 PM
- nice nice
Advertisement
Add Comment
Please, Sign In to add comment