实用程序CLI意外关闭(退出代码1):Ionic

时间:2018-08-30 11:01:17

标签: ionic-framework ionic2 ionic3

我已经从github下载了代码,当我尝试执行它时(使用ionic serve命令),我遇到了

错误
ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729               --dev-logger-port 53703 --nobrowser
[app-scripts] D:\project-1\project-1\frontend\node_modules\node-sass\lib\binding              .js:15
[app-scripts]       throw new Error(errors.missingBinary());
[app-scripts]       ^
[app-scripts] Error: Missing binding D:\project-1\project-1\frontend\node_module              s\node-sass\vendor\win32-x64-64\binding.node
[app-scripts] Node Sass could not find a binding for your current environment: W              indows 64-bit with Node.js 10.x
[app-scripts] Found bindings for the following environments:
[app-scripts]   - Windows 64-bit with Node.js 8.x
[app-scripts] This usually happens because your environment has changed since ru              nning `npm install`.
[app-scripts] Run `npm rebuild node-sass --force` to build the binding for your               current environment.
[app-scripts]     at module.exports (D:\project-1\project-1\frontend\node_module              s\node-sass\lib\binding.js:15:13)
[app-scripts]     at Object.<anonymous> (D:\project-1\project-1\frontend\node_mo              dules\node-sass\lib\index.js:14:35)
[app-scripts]     at Module._compile (internal/modules/cjs/loader.js:689:30)
[app-scripts]     at Object.Module._extensions..js (internal/modules/cjs/loader.              js:700:10)
[app-scripts]     at Module.load (internal/modules/cjs/loader.js:599:32)
[app-scripts]     at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
[app-scripts]     at Function.Module._load (internal/modules/cjs/loader.js:530:3              )
[app-scripts]     at Module.require (internal/modules/cjs/loader.js:637:17)
[app-scripts]     at require (internal/modules/cjs/helpers.js:20:18)
[app-scripts]     at Object.<anonymous> (D:\project-1\project-1\frontend\node_mo              dules\@ionic\app-scripts\dist\core\bundle-components.js:6:16)

[ERROR] A utility CLI has unexpectedly closed (exit code 1).

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

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

删除节点模块,然后使用npm install再次安装

答案 1 :(得分:0)

现在好了,我的 node-sass 刚刚做了这个 "npm uninstall node-sass" "npm install node-sass" "npm rebuild node-sass

<块引用>

使用这个

 `npm rebuild node-sass`

<块引用>

如果没有完成,那么使用这个

`npm rebuild node-sass --force`