嗨,我正在尝试基于离子V1框架构建应用程序。该应用程序在构建时会在控制台上引发以下错误。
> ionic-v1 build
[11:49:25] Cannot load gulp: Error: Error in module: .\gulpfile.js:
Error: Cannot find module './array/insert'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\sagar\FourWin\node_modules\bower\lib\node_modules\mout\array.js:23:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
[11:49:25] Cannot run sass task: missing in gulpfile.js
我的package.json文件是这样的:
{
.
.
.
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
},
"devDependencies": {
"@ionic/v1-toolkit": "1.0.10",
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": []
}
如何处理此问题。我尝试npm install
来查看是否缺少任何软件包,但仍然存在相同的错误
答案 0 :(得分:0)
可以与我们分享您的gulpfile.js文件的内容吗?随着Ionic V1开始变老,可能不再包含内部依赖项...
答案 1 :(得分:0)
经过大约4个小时的工作后,我发现了问题所在。我不确定通过什么活动解决了问题,但是我在这里列出了我的步骤
问题已解决,但随后出现新问题,即找不到编译sass所需的Sass文件模块
Error: Node Sass does not yet support your current environment: Windows 64-bit with
Unsupported runtime (57)
然后我将gulp-sass版本从package.json中的"gulp-sass": "^3.1.0"
更改为"gulp-sass": "^2.0.4"
npm install
ionic cordova build android
问题解决了。