Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails at node-sass #6

Closed
rebuilt opened this issue Sep 10, 2021 · 4 comments
Closed

Installation fails at node-sass #6

rebuilt opened this issue Sep 10, 2021 · 4 comments

Comments

@rebuilt
Copy link

rebuilt commented Sep 10, 2021

Hello, thanks for your project. I'm trying to follow the steps in this book: https://www.apress.com/gp/book/9781484270516

The installer fails at the node-sass step.
There's a lot of information printed but I think the important bit is

error /home/{usr}/workspace/javascript/react/integratingd3withreact/your-project-name/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js

error.txt

❯ yarn -v
1.22.11

yarn add node-sass completes without error. I'm not sure what I should try.

@HelpMe-Pls
Copy link

HelpMe-Pls commented Sep 22, 2021

@EliEladElrom I'm having the same issue after executing the command yarn create react-app starter-project --template must-have-libraries, which might involves the version of node-sass that isn't compatible with my NodeJS version as per this link from StackOverFlow: https://stackoverflow.com/questions/60394291/error-node-modules-node-sass-command-failed

My node -v returns 16.9.1 which is the latest current version, while your node-sass version defined in the dependencies is 4.14.1
image

My solution is to update the node-sass version to >=4.14.1, which seems to work just fine after i run yarn to install the deps on a clone version of this repo. But again, after that i run yarn start, another error shown:
image

@EliEladElrom
Copy link
Owner

Hey @HelpMe-Pls thanks for the comment and finding out the issue and solution. It's better to specify exact version, what version of node-saas you using, is the latest version works?

@HelpMe-Pls
Copy link

@EliEladElrom, thank you for the suggest of exact version. I tried deleting node_modules and yarn.lock then specifying the latest version by running yarn add [email protected]. The output is exactly the same as my previous comment (of which i'm unable to find a solution). My current node-sass version (at global scope i believe) is also 6.0.1:
image

What i did above was trying to use the latest compatible versions of NodeJS and node-sass following their document, but for some vague reasons, the pair doesn't work. So i tried the LTS version of NodeJS which seems to be a compatible match with the 4.14.1 version that you specified (according to https://www.npmjs.com/package/node-sass), by running the commands: nvm install v14.17.6 and nvm use 14.17.6, deleting node_modules and yarn.lock once again then run yarn and yarn start, works just fine, problem solved 💯
image

It just seems like node-sass prefer to work with the LTS version of NodeJS, i don't know why it doesn't work with the latest current version. It is what it is, @rebuilt, i hope you try out my possible solution for this issue and see if it solves the problem, for now...

@EliEladElrom
Copy link
Owner

EliEladElrom commented Sep 23, 2021

Hey @HelpMe-Pls this is typical issue with nodejs/npm and other libraries. For that reason I also set this project on docker if you familiar so you don't need to deal with envs;
$ docker run -p 8080:80 elieladelrom/cra-template-must-have-libraries thanks for putting this out here, I hope it will be useful for others. Lastly, I just added dependabot.yml that will help identify libraries that needs to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants