错误:Node Sass尚不支持您当前的环境:Windows 64位,运行时不受支持(67)

时间:2018-11-20 12:11:45

标签: ionic-framework npm sass

我已经更新了旧的离子应用程序。更新后,出现以下错误:

错误:Node Sass尚不支持您当前的环境:Windows 64位,运行时不受支持(67)

我已经用谷歌搜索了答案。但是没有任何帮助。我试图删除de node_modules目录,也重新安装了node sass。还要降级。

NPM version: 6.4.1
Node: v11.1.0

npm ls node-sass
fonville-app@0.0.1 C:\Apps\xxx
+-- @ionic/app-scripts@3.2.0
| `-- node-sass@4.9.0
+-- gulp-sass@3.2.1
| `-- node-sass@4.11.0  deduped
`-- node-sass@4.11.0


>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.

有人可以帮助我吗?

编辑:

好像是版本号不匹配。更改后,我又遇到了一个错误。有人可以帮我吗?

>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 个答案:

答案 0 :(得分:0)

运行npm rebuild node-sass也有帮助。

答案 1 :(得分:0)

这是因为节点版本/环境变化。

  1. 从您的项目中删除文件夹 node_modules

  2. 运行命令。

<块引用>

ionic serve --lab

  1. 对@ionic/app-scripts 说 Yes

大功告成。