ionic4 checkout出的项目运行失败

简介: ionic4 checkout出的项目运行失败

用SVN检出项目之后,直接运行ionic serve 结果出现以下错误

 ERROR in ./src/global.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
[ng] Module build failed (from ./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js):
[ng] Error: Missing binding E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\vendor\win32-x64-67\binding.node
[ng] Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 11.x
[ng] Found bindings for the following environments:
[ng]   - Windows 64-bit with Node.js 10.x
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\lib\binding.js:15:13)
[ng]     at Object.<anonymous> (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\lib\index.js:14:35)
[ng]     at Module._compile (internal/modules/cjs/loader.js:816:30)
[ng]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
[ng]     at Module.load (internal/modules/cjs/loader.js:685:32)
[ng]     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
[ng]     at Module.require (internal/modules/cjs/loader.js:723:19)
[ng]     at require (internal/modules/cjs/helpers.js:14:16)
[ng]     at Object.sassLoader (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\_sass-loader@7.1.0@sass-loader\lib\loader.js:46:72)
[ng] ERROR in ./src/theme/variables.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js??ref--14-3!./src/theme/variables.scss)
[ng] Module build failed (from ./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js):
[ng] Error: Missing binding E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\vendor\win32-x64-67\binding.node
[ng] Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 11.x
[ng] Found bindings for the following environments:
[ng]   - Windows 64-bit with Node.js 10.x
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\lib\binding.js:15:13)
[ng]     at Object.<anonymous> (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\lib\index.js:14:35)
[ng]     at Module._compile (internal/modules/cjs/loader.js:816:30)
[ng]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
[ng]     at Module.load (internal/modules/cjs/loader.js:685:32)
[ng]     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
[ng]     at Module.require (internal/modules/cjs/loader.js:723:19)
[ng]     at require (internal/modules/cjs/helpers.js:14:16)
[ng]     at Object.sassLoader (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\_sass-loader@7.1.0@sass-loader\lib\loader.js:46:72)
[ng] ERROR in ./src/app/tab1/tab1.page.scss
[ng] Module build failed (from ./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js):
[ng] Error: Missing binding E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\vendor\win32-x64-67\binding.node
[ng] Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 11.x
[ng] Found bindings for the following environments:
[ng]   - Windows 64-bit with Node.js 10.x
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\lib\binding.js:15:13)
[ng]     at Object.<anonymous> (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\node-sass\lib\index.js:14:35)
[ng]     at Module._compile (internal/modules/cjs/loader.js:816:30)
[ng]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
[ng]     at Module.load (internal/modules/cjs/loader.js:685:32)
[ng]     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
[ng]     at Module.require (internal/modules/cjs/loader.js:723:19)
[ng]     at require (internal/modules/cjs/helpers.js:14:16)
[ng]     at Object.sassLoader (E:\项目\orderSystem_net\trunk\OrderSystem_V2.0-phone\ionicphone\node_modules\_sass-loader@7.1.0@sass-loader\lib\loader.js:46:72)

解决方案

主要是windows平台缺少编译环境,

1、先运行:

npm install -g node-gyp 

2、然后运行:运行

npm install --global --production windows-build-tools //可以自动安装跨平台的编译器:

3.先卸载之前的sass,然后再下一步

npm uninstall node-sass

4.重新安装

npm install node-sass

大功告成

目录
相关文章
|
6月前
|
JavaScript
ionic4 如何安装和创建项目
ionic4 如何安装和创建项目
68 1
|
3月前
|
Android开发 iOS开发
[ionic]解决运行Android、IOS出现Could not find the web assets directory
[ionic]解决运行Android、IOS出现Could not find the web assets directory
38 1
|
Web App开发 Java 开发工具
ionic和cordova初探--从安装到运行首个app
好多人说ionic好用,一直要推荐我用,我就不信了,来安装玩一下试试效果。实践出真知!安装过程各种坑,工具太多了,太麻烦了,差点放弃(还好坚持下来呢)。 1.安装node 许多前端工具的安装都依赖于node的包管理器npm,Node官网: https://nodejs.org/ 安装完成后在cmd中输入 npm -v 回车。
2419 0
|
JavaScript Android开发
|
JavaScript 定位技术 开发工具
在 Ionic2 TypeScript 项目中导入第三方 JS 库
原文发表于我的技术博客 本文分享了在Ionic2 TypeScript 项目中导入第三方 JS 库的方法,供参考。原文发表于我的技术博客 1. Typings 的方式 因在 TypeScript 中引用之前的 JS 库还需要引入对应的类型定义,也就是 .d.ts 文件。
1417 0
|
JavaScript Android开发 iOS开发
实战使用Axure设计App,使用WebStorm开发(2) – 创建 Ionic 项目
系列文章 实战使用Axure设计App,使用WebStorm开发(1) – 用Axure描述需求  实战使用Axure设计App,使用WebStorm开发(2) – 创建 Ionic 项目   实战使用Axure设计App,使用WebStorm开发(3) – 构建页面架构  实战使用Axu...
1485 0
|
JavaScript 前端开发 Android开发
Ionic 开发中遇到的常见问题及解决方案
Ionic 常见问题及解决方案
8374 0
|
Web App开发 索引
Ionic 2 开发(一)_安装与目录结构
由于公司开始使用后ionic 进行前段开发,现在需要学习下ionic,虽然是后台开发,但是还是有必要了解下的 安装Node.js 官网:http://nodejs.cn/ 自行下载安装 安装Ionic npm install -g cordova npm install -g ionic 设置淘宝镜像 npm config set registry https://registry.
1095 0
|
Web App开发 移动开发 JavaScript
Win10 UWP开发系列:使用VS2015 Update2+ionic开发第一个Cordova App
原文:Win10 UWP开发系列:使用VS2015 Update2+ionic开发第一个Cordova App 安装VS2015 Update2的过程是非常曲折的。还好经过不懈的努力,终于折腾成功了。 如果开发Cordova项目的话,推荐大家用一下ionic这个框架,效果还不错。
1791 0