1

I have an angular project 7.1 which was working fine before but after upgrading to ubuntu 19.10 when I do npm install I get the following error:

> [email protected] install /home/gabb/dev/homepage/node_modules/node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-79_binding.node Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-79_binding.node": HTTP error 404 Not Found Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g. export HTTP_PROXY=http://example.com:1234 or configure npm proxy via npm config set proxy http://example.com:8080 node[1617]: ../src/signal_wrap.cc:159:void node::DecreaseSignalHandlerCount(int): Assertion `(new_handler_count) >= (0)' failed. 1: 0x9f0390 node::Abort() [node] 2: 0x9f0417 [node] 3: 0xa91bdc node::DecreaseSignalHandlerCount(int) [node] 4: 0xa91cb4 [node] 5: 0x98fbd5 node::Environment::CleanupHandles() [node] 6: 0x98fe6b node::Environment::RunCleanup() [node] 7: 0xa2d2f0 node::NodeMainInstance::Run() [node] 8: 0x9c1311 node::Start(int, char**) [node] 9: 0x7fbff275e1e3 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6] 10: 0x95ed25 [node] Aborted (core dumped) 

This link https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-79_binding.node really does return 404. If I go to the package.json file there is no node-sass entry. Anyone can explain why it is trying to install [email protected] if its not in the package.json. Is it a dependency of angular? If so do I need to upgrade angular to a new version to be able to get the latest node-sass version?

This seems a bit complicated for just upgrading to the latest ubuntu version, especially since its very hard to upgrade angular to another version.

package.json: https://pastebin.com/w51Kna2g

To clarify I would like to know an explanation about this not just some commands that "fix" it.

Edit: Seems its a dependency of @angular-devkit/build-angular where I have version 0.13.6

When I update that to the latest version I get other errors.

1
  • partial answer to your question why it's being installed is that its a angular cli optional dependency not your own project direct dependency see here github.com/angular/angular-cli/blob/… Commented Jan 21, 2020 at 10:48

2 Answers 2

1

So the answer is that my angular-devkit/build-angular version depends on node-sass v4.11.0 but node-sass v4.11.0 does not support my NodeJS version. So I have to update angular-devkit to a version which has node sass 4.13.0.

Which apparently theres none of, 0.13.9 is the last one that supports angular 7 and it has 4.12.0 as node-sass version.

Which means that to code on ubuntu 19.10 I will need to have angular 8+? Which is not possible for me as some packages I use do not support that. This whole project was built in 2019 and it's already a pita to update. Gonna have to use docker to emulate an ubuntu 19.04 to be able to code angular 7.

Sign up to request clarification or add additional context in comments.

Comments

0

Following up on your answer:

So the answer is that my angular-devkit/build-angular version depends on node-sass v4.11.0 but node-sass v4.11.0 does not support my linux version

It would be more correct to say that there is no pre-compiled binary available for your specific platform version. During post-install, it tries to find one that doesn't exist which results in the error. What you can do, is try and build one from the source yourself.

There is a section in the the node-sass README that talks about creating a binary yourself by following these steps:

Check out the project: git clone --recursive https://github.com/sass/node-sass.git cd node-sass npm install node scripts/build -f # use -d switch for debug release # if succeeded, it will generate and move # the binary in vendor directory. 

Once you have a binary, there are some env variables you can use to reference it.

I came across this section of the README last week trying to set up a project at work. I could not get a node-sass binary, but my problem was more related to working behind a corporate proxy. I ended up downloading a node binary file (instead of creating it myself) and simply copying the vendor folder into node_modules/node-sass of the project (i know, not super ideal).

1 Comment

So yes this worked, Follow the building of the binary on your system, then run the env variable, you dont really need to move it to the vendor folder inside your project, you can just set an env variable on your system with the location of the node-sass binding file that you built.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.