sass / node-sass-middleware

connect middleware extracted from node-sass
MIT License
263 stars 84 forks source link

Can't install node-sass-middleware with latest node LTS (16.16.0) #157

Closed kelmore5 closed 1 year ago

kelmore5 commented 2 years ago

This might be a yarn error, but I still think it's worth looking into...

Today when I installed node-sass-middleware on node's latest LTS (16.16.0), I got back a build error from node-gyp. This happened because the latest version of node-sass (7.0+) is only supported on future versions of Node (17+), and node-sass is listed as a dependency for this project's "package.json" files.

I tried to install an earlier version of node-sass-middleware to no avail. Basically every time node-sass-middleware tried to get built, it would try to install the latest version of node-sass, and then crash.

I think the dependencies in the "package.json" files for the older versions of node-sass-middleware need to be updated. Specifically for versions 0.11.0 and (probably) below. It'd be great if instead of listing the node-sass dependency as:

"dependencies": { ..., "node-sass": "^4.13.1" }

it was listed as the latest version available to that package at the time, e.g:

"dependencies": { ..., "node-sass": "<7.0.0" }

or something along those lines.

Because right now, I believe this package is having build problems on LTS node. At least with yarn users. Let me know if you want me to post the full build error log.

PS: Anyone who sees this - I fixed the bug by running build, letting it crash, editing the "package.json" file to the above ^ version for node-sass, and then re-running

Edit: Forgot code blocks Edit 2: Still having this issue and not sure what the fix should be

YasharF commented 1 year ago

Is this still an issue?

kelmore5 commented 1 year ago

Ah, I think I was mistaken in my original post. Took a second look. It turns out, version 0.11.0 can't install on node v16 because v16 doesn't support node-sass 4.14. Which would've made sense at the time! node v16 only supports node-sass 6 (?).

Regardless, node-sass-middleware definitely works on latest LTS now (18) and version 1.0.0 will work on node v16. We can definitely close, thanks