2
votes

I've updated an old ionic application. After the update I get the following error:

Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (67)

I've googled and searched for the answer. But nothing helps. I've tried to delete de node_modules directory, also reinstalling node sass. Also downgrading.

NPM version: 6.4.1
Node: v11.1.0

npm ls node-sass
[email protected] C:\Apps\xxx
+-- @ionic/[email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]  deduped
`-- [email protected]


>ionic serve
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port                     35729 --dev-logger-port 53703 --nobrowser
[app-scripts] C:\Users\kevin\AppData\Roaming\npm\node_modules\@ionic\app-    scripts\node_modules\node-sass\lib\binding.js:13
[app-scripts]       throw new Error(errors.unsupportedEnvironment());
[app-scripts]       ^
[app-scripts] Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (67)
[app-scripts] For more information on which environments are supported     please see:
[app-scripts] https://github.com/sass/node-sass/releases/tag/v4.9.0
[app-scripts]     at module.exports     (C:\Users\kevin\AppData\Roaming\npm\node_modules\@ionic\app-    scripts\node_modules\node-sass\lib\binding.js:13:13)
[app-scripts]     at Object.<anonymous>     (C:\Users\kevin\AppData\Roaming\npm\node_modules\@ionic\app-    scripts\node_modules\node-sass\lib\index.js:14:35)
[app-scripts]     at Module._compile (internal/modules/cjs/loader.js:707:30)
[app-scripts]     at Object.Module._extensions..js     (internal/modules/cjs/loader.js:718:10)
[app-scripts]     at Module.load (internal/modules/cjs/loader.js:605:32)
[app-scripts]     at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
[app-scripts]     at Function.Module._load     (internal/modules/cjs/loader.js:536:3)
[app-scripts]     at Module.require (internal/modules/cjs/loader.js:643:17)
[app-scripts]     at require (internal/modules/cjs/helpers.js:22:18)
[app-scripts]     at Object.<anonymous>     (C:\Users\kevin\AppData\Roaming\npm\node_modules\@ionic\app-    scripts\dist\core\bundle-components.js:6:16)

[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).

        The Ionic CLI will exit. Please check any output above for error         details.

Can anyone help me?

Edit:

It looks like it was an mismatching version numbers. After the change I got another error. Does anyone can help me with this?

>ionic cordova build android --prod --release --minifyjs --minifycss
> ionic-app-scripts build --prod --minifyjs --minifycss --target cordova --platform android
[09:04:53]  ionic-app-scripts 3.2.0
[09:04:53]  build prod started ...
[09:04:53]  clean started ...
[09:04:53]  clean finished in 3 ms
[09:04:53]  copy started ...
[09:04:53]  deeplinks started ...
[09:04:53]  deeplinks finished in 154 ms
[09:04:53]  ngc started ...
[09:04:55]  ionic-app-script task: "build"
[09:04:55]  Error: Cannot find module '@angular/compiler-cli/ngtools2'
Error: Cannot find module '@angular/compiler-cli/ngtools2'
    at Function.Module._resolveFilename     (internal/modules/cjs/loader.js:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
    at Module.require (internal/modules/cjs/loader.js:643:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at C:\Users\kevin\AppData\Roaming\npm\node_modules\@ionic\app-    scripts\dist\aot\aot-compiler.js:206:90
[ERROR] An error occurred while running subprocess ionic-app-scripts.

        ionic-app-scripts build --prod --minifyjs --minifycss --target     cordova --platfor... exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.
2
I've had similar issues once. For me it was a version missmatch between ionic/app-scripts and node-sass. The combination of ionic/[email protected] [email protected] works on my machine (also Windows 64-bit). - Phonolog
Thanks, indeed was it a combination of mismatching version. Only after the change I got another error.. [09:04:55] Error: Cannot find module '@angular/compiler-cli/ngtools2' Error: Cannot find module '@angular/compiler-cli/ngtools2' - kevin4hrens

2 Answers

2
votes

running npm rebuild node-sass also helps.

0
votes

Its because of node version/environment change.

  1. Remove folder node_modules from your project.

  2. Run command.

ionic serve --lab

  1. Say Yes for @ionic/app-scripts

Its Done.