NPM node-sass installation fails - node.js

I am trying to install node-sass in a project, which perfectly builds and runs on my pc but on my surface I am having major issues when trying to install the packages.
Note: I have tryed reinstalling and rebuilding the project several times.
Summary of the error:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Max-T\Documents\Sources\StaffMangerV2\black-dashboard-pro-react-v1.0.0\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Max-T\\Documents\\Sources\\StaffMangerV2\\black-dashboard-pro-react-v1.0.0\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Max-T\Documents\Sources\StaffMangerV2\black-dashboard-pro-react-v1.0.0\node_modules\node-sass
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 postinstall 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\Max-T\AppData\Roaming\npm-cache\_logs\2019-10-30T10_05_01_386Z-debug.log
package.json => https://hastebin.com/azetegukes.pl
too much coode so I had to paste it elsewhere.

You're using Node 12, and node-sass needs to be at least 4.12 to support that version https://github.com/sass/node-sass#node-version-support-policy

If anyone runs into this lately... the easiest fix is to replace node-sass with just sass in your dependencies. It's the more recently maintained version and I only had to change 1 line of code with how it's initialized and all of my existing code was already compatible.
There are more details at https://sass-lang.com/blog/libsass-is-deprecated under How to migrate.

try this command it works for me
sudo npm install -g --unsafe-perm node-sass

Don't use node-sass anymore
node-sass is deprecated. Instead use the new version which is sass.
You can uninstall the old and install the new one with this command
npm uninstall node-sass
npm install sass

After more than 2 hours of trying all sorts of ways (cleaning npm cache, deleting node_modules, trying to install with global switch -g, etc.) to install node-sass and failing every time, I finally changed the mirror to china and it immediately worked for me!! (I know it kinda doesn't make any sense, considering the error I was getting)
Just for reference, this was the error I was receiving before it finally worked:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.14.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.14.0 postinstall 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\****\AppData\Roaming\npm-cache\_logs\2020-06-06T13_56_56_768Z-debug.log
My Node version: v12.18.0
node-sass version in package.json: "^4.14.0"
I changed the mirror as stated in the node-sass npm page.
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass
Hope that helps.

The best option would probably be to replace node-sass lib with sass one.
But in our case I fixed that by installing nvm and setting local node version to 14.17.6
My node-sass version is 4.14.1

Related

Unable to install chartjs-node with npm, due to file cairo.h missing/Failed at the canvas#1.6.13 install script

I am working on a project from some years ago that I have to debug/get running again and so far it has been a pain. I was able to install most dependencies, but apart from one time I got lucky, but can not reproduce this, I always fail to install chartjs-node. I use node v12.18.1 and npm 6.14.5 and Visual Studio Code for the terminal.
Every time I try npm i chartjs-node or npm i in general I get the following:
....
c:\users\user\desktop\sensqbot\repo\node_modules\chartjs-node\node_modules\canvas\src\canvas.h(19): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "cairo.h": No such file or dire
ctory (Quelldatei wird kompiliert ..\src\CanvasPattern.cc) [C:\Users\User\Desktop\SensQBot\repo\node_modules\chartjs-node\node_modules\canvas\build\canvas.vcxproj]
c:\users\user\desktop\sensqbot\repo\node_modules\chartjs-node\node_modules\canvas\src\canvas.h(19): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "cairo.h": No such file or dire
ctory (Quelldatei wird kompiliert ..\src\CanvasRenderingContext2d.cc) [C:\Users\User\Desktop\SensQBot\repo\node_modules\chartjs-node\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\Desktop\SensQBot\repo\node_modules\chartjs-node\node_modules\canvas
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN The package ava is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.2 (node_modules\cairo\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas#1.6.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#1.6.13 install 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\User\AppData\Roaming\npm-cache\_logs\2021-08-03T16_49_06_319Z-debug.log
I followed guides for installing the dependencies like canvas and cairo and that should be fine, I have GTK manually installed to C:/GTK, I have the libjpeg installed, node-gyp is installed globally: https://github.com/Automattic/node-canvas/wiki/Installation%3A-Windows
And installing cairo and canvas went just fine, I just do not understand why I was able to install chartjs-node once and never again, unfortunately, I lost the folder, as I tested that I could have just copied it into the node_modules of a project and it would run.
Sry if the question is too unspecific, I am just a beginner with node/npm and have not written the project myself, so I just stumbled from error to error until it became closer to running. Please ask if you need a complete log or more specs. Thank you very much in advance.
In the error, it says "Failed at the canvas#1.6.13 install script." and below "This is probably not a problem with npm. There is likely additional logging output above."
Directly above the error says "canvas#1.6.13 install: node-gyp rebuild", so you should try running node-gyp rebuild
If this doesn't work, try this:
run: npm cache clean --force
delete node_modules
delete packagelock.json
run: npm install
What in the end at least got the project running, was the following:
npm install chart.js#2.7.*
npm install chartjs-node#^1.7.1 --force
npm install
So, when someone has a module that seems just impossible to install, I suggest running npm audit, this showed me, that chartjs-node was also missing chart.js#2.7.* and then I just had to force the install, I am almost sure, as I just ignored the errors, this will lead to problems later, but at least I have a build to try out for now! PS. also lowering the version of node-gyp might help for older projects, at least I had this feeling here.

Ionic Framework : Ionic build fails while creating the project (v4.12.0)

I have ionic installed in my system. When i run ionic run app tabs it installs all the npm packages but then the prompt falls to
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node":
HTTP error 404 Not Found
Then it fails with the prompt showing
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/l3g0b0y/code/greenlink/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/home/l3g0b0y/.nvm/versions/node/v12.0.0/bin/node" "/home/l3g0b0y/code/greenlink/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/l3g0b0y/code/greenlink/node_modules/node-sass
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.8 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.11.0 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.11.0 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
I have already tried removing node_modules and reinstall the packages. I tried reinstalling ionic-cli as well. Which doesn't work.
I'm using
node v12.0.0
npm v6.9.0
ionic v4.12.0
Indeed, the version https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node is not available because you are using node v12 and try to get unsupported version of node-sass for node v12.
The solution is to downgrade your node version to v11 or upgrade your node-sass dependency to the latest.
If you (for visitors having the same issue w/ another library. Here, it is ionic) are using node-sass as a vendor library, downgrade to node v11 and notify the library developer team to the need for an update.
Another option is to add the node 11 to your dev-dependencies:
npm i --save-dev node#11

npm install: Failed at the node-sass#3.13.1 postinstall script

I have a angular application: https://github.com/XBITSwitzerland/ngx-admin/tree/ng2-admin
And now I try to do: npm install
But I get this error (The compete Output of the command was way too long, so I just share here the last part):
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\github\ngx-admin\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\github\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\github\ngx-admin\node_modules\wintersmith-sassy\node_modules\node-sass
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN ngx-toastr#4.4.1 requires a peer of #angular/core#^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-toastr#4.4.1 requires a peer of #angular/common#^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.1 postinstall 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\danyb\AppData\Roaming\npm-cache\_logs\2019-01-29T18_25_12_699Z-debug.log
Does someone have an Idea why this error occurs and how to solve it?
If you run into this issue, read this page: https://www.bramvandenbulcke.be/en/kb/failed-node-sass3131-postinstall-script
The solution in my case:
1) Delete the package-lock.json file
2) npm install gulp-sass --save-dev
3) npm install node-sass#latest
Version specific notes:
node-sass#3.13.1 runs only on versions of Node.js up to v7 as stated in the release notes:
I think this is happening because you're missing the node-sass module. Try the following and rerun your build script and see if this resolves your issue:
npm install node-sass#latest
Also, I see you're using fsevents on a Windows platform, just a warning this module is only supported for Native access to OS X FSEvents
I had error node-sass#3.13.1 postinstall: node scripts/build.js on npm install after this message
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/linux-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/linux-x64-72_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
> core-js#2.6.9 postinstall /var/www/my/armat/www/node_modules/core-js
> node scripts/postinstall || echo "ignore"
and spent hours to find solution. I was trying to install it on laravel 5.2 that uses older versions of node and npm this helped me
$ npm install -g n
$ n 6.10.2 // selecting version you need in my case 6.10.2
$ npm install -g npm#3.10.10 // same for npm
hope this will help somebody else ^_^
#######UPDATE###########
nvm install 6.10.2
nvm use 6.10.2
npm install -g npm#3.10.10
only delete
package-lock.json
file
and do npm install again
I also received the same error
"npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#3.13.1 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above."
Solution:
I increased node-sass and gulp-sass versions to latest in package.json file, then issue got fixed.
If you scroll further up in the error output and you see something like:
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
You can fix it on windows with the following steps:
delete node_modules folder
run npm install --global windows-build-toolsin powershell as admin
reinstalling node modules or node-sass with npm install
For me, problem was with the Linux directory permissions. Even with sudo and root user I couldn't make it work.
The solution to me was to change project directory owner as follows:
sudo chown my_user:my_user -R /path/to/project
Do the following commands respectively:
rm -rf package-lock.json
npm install node-sass#latest
For Ubuntu
Delete the package-lock.json file
sudo npm install gulp-sass --save-dev
sudo npm install node-sass#latest
If you use Visual Studio run following command:
npm cache clean --force
npm config set msvs_version 2019 --global
where 2019 is the version of Visual Studio
If you are using OpenBSD, that's because you need g++. Install it using
pkg_add g++
But, it gets installed as ec++, on /usr/local/bin, so you can copy, rename, or create a symlink to it using:
ln -s /usr/local/bin/ec++ /usr/local/bin/g++
Do the npm install again and it should work

Installing angular-cli

angular is pretty new to me and english is not my first language so I apologize in advance.
I'm a student and I have to do an app using the MEAN platform. We never worked with any MEAN component, or javascript in college but now I have to do this project. I'm following this tutorial -> https://www.youtube.com/watch?v=wtIvu085uU0&list=PLTPtZWpWLI00vlAPQnDt8OlPwoYxuMCQo&index=4 and everything up to 45 minutes into the video worked just fine. At 45 min it says I have to install #angular/cli but I got errors the first time I did it. Then I tried to type npm install #angular/cli again and then there were no errors. It was just like it should be, like it is in the video. But, when I typed ng new client it said
ng is not recognized as an internal or external command, operable program or batch file.
I don't know what to do, I tried to install angular-cli again for few times but every time it was the same. I'm desperate.
Versions:
node --version = v6.11.3
npm --version = 3.10.10
Windows 10
Errors I get when I type "npm install #angular/cli":
npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or locked, rename 'C:\Users\Loran\AppData\Local\Temp\npm-9616-ee3846a1\registry.npmjs.org\eventemitter3-\eventemitter3-1.2.0.tgz.1057597416' -> 'C:\Users\Loran\AppData\Local\Temp\npm-9616-ee3846a1\registry.npmjs.org\eventemitter3-\eventemitter3-1.2.0.tgz'
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "#angular/cli"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
kontakti#1.0.0 D:\Project\kontakti
`-- #angular/cli#1.4.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN kontakti#1.0.0 No description
npm WARN kontakti#1.0.0 No repository field.
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "#angular/cli"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
npm ERR! Please include the following file with any support request:
npm ERR! D:\Project\kontakti\npm-debug.log
For these versions:
node --version = v6.11.3
npm --version = 3.10.10
You Should try Angular CLI 4
$npm install -g #angular/cli#1.4
To use the ng command in the terminal, you need to install Angular CLI globally.
Run this command to install : npm install -g #angular/cli.

node-gyp error when running npm install

I'm new to node and a bit out of my depth here. Experiencing this error on both Mac OS X and Centos 6. Happens in all the npm install xxx commands I've tried. Any suggestions on how to get around this error much appreciated.
Similar to npm install gives node-gyp error but I do not have spaces in my username which is what solved his issue.
npm install canvas
> canvas#1.6.6 install /home/test1/ng2-webpack-demo/node_modules/canvas
> node-gyp rebuild
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in
binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit
(/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:215:12)
gyp ERR! System Linux 2.6.32-642.4.2.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-
gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test1/ng2-webpack-demo/node_modules/canvas
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN #angular/animations#4.3.6 requires a peer of #angular/core#4.3.6 but
none was installed.
npm WARN #angular/material#2.0.0-beta.8 requires a peer of #angular/cdk#2.0.0-
beta.8 but none was installed.
npm WARN #angular/material#2.0.0-beta.8 requires a peer of
#angular/core#^4.0.0 but none was installed.
npm WARN #angular/material#2.0.0-beta.8 requires a peer of
#angular/common#^4.0.0 but none was installed.
npm WARN #ngtools/webpack#1.2.10 requires a peer of #angular/tsc-
wrapped#^0.5.0 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.2
(node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current:
{"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas#1.6.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#1.6.6 install 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! /home/test1/.npm/_logs/2017-08-29T15_54_58_848Z-debug.log
This is a known canvas issue, probably caused by missing native libs.
Try this see if it helps:
sudo npm uninstall -g node-gyp
sudo npm install -g node-gyp
brew install pkg-config cairo libpng jpeg giflib
npm i canvas
Source: https://github.com/Automattic/node-canvas/issues/913#issuecomment-368042394
I've same error the reason was that I don't have clang compiler installed.
My solution to this was to install build-essential package
sudo apt-get install build-essential
I'm using Ubuntu 20.1 release

Resources