Skip to content

Instantly share code, notes, and snippets.

@josephdicdican
Last active January 6, 2020 09:03
Show Gist options
  • Save josephdicdican/c422a5e9806c5791e6f8cc6fa550c8e6 to your computer and use it in GitHub Desktop.
Save josephdicdican/c422a5e9806c5791e6f8cc6fa550c8e6 to your computer and use it in GitHub Desktop.
Ionic Project - Node SASS Error on npm install

Ionic Project (ionic@5.4.13) Node SASS Error on npm install

Error

MINGW64 ~/Sites/bitbucket/**ionic-app (master)
$ npm install
npm WARN deprecated rollup-plugin-commonjs@8.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-commonjs.
npm WARN deprecated rollup-plugin-node-resolve@3.0.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve.
npm WARN deprecated babili@0.1.2: babili has been renamed to babel-minify. Please update to babel-minify
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated rollup-plugin-json@2.3.0: This module has been deprecated and is no longer maintained. Please use @rollup/plugin-json.
npm WARN deprecated babel-preset-babili@0.1.4: babili has been renamed to babel-minify. Please update to babel-preset-minify
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys

> node-sass@4.5.3 install C:\Users\WebDev\Sites\bitbucket\**ionic-app\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-64_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-64_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.11 postinstall C:\Users\WebDev\Sites\bitbucket\**ionic-app\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Workaround

Workaround 1: Tested this but error still occurs - sass/node-sass#2773 (comment)

MINGW64 ~/Sites/bitbucket/**ionic-app (master)
$ npm install --unsafe-perm -g node-sass
C:\Users\WebDev\AppData\Roaming\npm\node-sass -> C:\Users\WebDev\AppData\Roaming\npm\node_modules\node-sass\bin\node-sass

> node-sass@4.13.0 install C:\Users\WebDev\AppData\Roaming\npm\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-64_binding.node
Download complete
Binary saved to C:\Users\WebDev\AppData\Roaming\npm\node_modules\node-sass\vendor\win32-x64-64\binding.node
Caching binary to C:\Users\WebDev\AppData\Roaming\npm-cache\node-sass\4.13.0\win32-x64-64_binding.node

> node-sass@4.13.0 postinstall C:\Users\WebDev\AppData\Roaming\npm\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\WebDev\AppData\Roaming\npm\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
+ node-sass@4.13.0
added 174 packages from 138 contributors in 22.05s

Workaround 2: sass/node-sass#2773 (comment)

$ npm install --global --production windows-build-tools
# waited until finished around 5 minutes
$ npm install 
$ npm run ionic:serve

> ionic-hello-world@ ionic:serve C:\Users\WebDev\Sites\bitbucket\**ionic-app
> ionic-app-scripts serve

[16:45:59]  ionic-app-scripts 2.0.2 
[16:45:59]  watch started ... 
[16:45:59]  build dev started ... 
[16:45:59]  clean started ... 
[16:45:59]  clean finished in 7 ms 
[16:45:59]  copy started ... 
[16:45:59]  transpile started ... 
[16:46:06]  transpile finished in 6.72 s 
[16:46:06]  preprocess started ... 
[16:46:06]  deeplinks started ... 
[16:46:06]  deeplinks finished in 291 ms 
[16:46:06]  preprocess finished in 292 ms 
[16:46:06]  webpack started ... 
[16:46:07]  copy finished in 7.38 s 
[16:46:14]  webpack finished in 7.65 s 
[16:46:14]  sass started ... 
[16:46:18]  sass finished in 3.64 s 
[16:46:18]  postprocess started ... 
[16:46:18]  postprocess finished in 8 ms 
[16:46:18]  lint started ... 
[16:46:18]  build dev finished in 18.72 s 
[16:46:18]  watch ready in 19.16 s 

And it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment