Ionic Setup Sass给了我错误

时间:2015-12-22 01:47:25

标签: sass ionic-framework ionic gulp-sass node-sass

我一直在研究寻找解决方案的地方。我在Windows 10上。我无法运行"离子设置sass"。以下是我以管理员身份运行时收到的错误。

Ionic project ready to use Sass!
 * Customize the app using scss/ionic.app.scss
 * Run ionic serve to start a local dev server and watch/compile Sass to CSS

C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22
    throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
    ^

Error: `libsass` bindings not found. Try reinstalling `node-sass`?
    at getBinding (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22:11)
    at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:23)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\index.js:3:17)
    at Module._compile (module.js:425:26)

Error running gulp sass



Exception with  (CLI v1.7.12)

Your system information:

Cordova CLI: 5.4.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.0.1
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
OS:
Node Version: v5.1.0

我尝试卸载node-sass并使用&#34; npm uninstall node-sass&#34;再次安装它。和&#34; npm安装node-sass&#34;。我尝试删除node_modules文件夹并执行&#34; npm install&#34;再次。

当我使用&#34;离子服务&#34;看看我的应用程序,这些是我得到的错误:

ionic $ C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22
    throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
    ^

Error: `libsass` bindings not found. Try reinstalling `node-sass`?
    at getBinding (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22:11)
    at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:23)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\index.js:3:17)
    at Module._compile (module.js:425:26)

我也试过卸载并重新安装gulp-sass。当我运行npm install gulp-sass时,这就是我得到的:

$ npm install gulp-sass
npm WARN deprecated pangyp@2.3.3: use node-gyp@3+ instead
npm WARN prefer global pangyp@2.3.3 should be installed with -g

> node-sass@2.1.1 install C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js

Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-5.1/binding.node

> node-sass@2.1.1 postinstall C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js

module.js:340
    throw err;
    ^

Error: Cannot find module 'C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\bin\node-gyp'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:289:25)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:138:18)
    at node.js:974:3
Build failed
ionfullapp@1.2.0 C:\Users\Chase\Desktop\ionFullApp_1.3.0
├─┬ bower@1.7.1
│ ├─┬ bower-json@0.4.0
│ │ └── graceful-fs@2.0.3
│ ├─┬ configstore@0.3.2
│ │ └── object-assign@2.1.1
│ ├─┬ glob@4.5.3
│ │ └── minimatch@2.0.10
│ ├── graceful-fs@3.0.8
│ ├─┬ mkdirp@0.5.0
│ │ └── minimist@0.0.8
│ └─┬ request@2.53.0
│   ├── aws-sign2@0.5.0
│   ├─┬ bl@0.9.4
│   │ └── readable-stream@1.0.33
│   ├─┬ combined-stream@0.0.7
│   │ └── delayed-stream@0.0.5
│   ├── forever-agent@0.5.2
│   ├─┬ form-data@0.2.0
│   │ └── async@0.9.2
│   ├─┬ http-signature@0.10.1
│   │ ├── asn1@0.1.11
│   │ └── ctype@0.5.3
│   ├─┬ mime-types@2.0.14
│   │ └── mime-db@1.12.0
│   └── qs@2.3.3
├─┬ gulp@3.9.0
│ ├── gulp-util@3.0.7
│ └─┬ vinyl-fs@0.3.14
│   ├─┬ glob-stream@3.1.18
│   │ ├── glob@4.5.3
│   │ ├── minimatch@2.0.10
│   │ └─┬ through2@0.6.5
│   │   └── readable-stream@1.0.33
│   ├── graceful-fs@3.0.8
│   └─┬ through2@0.6.5
│     └── readable-stream@1.0.33
├─┬ gulp-angular-templatecache@1.8.0
│ ├─┬ gulp-concat@2.6.0
│ │ ├── gulp-util@3.0.7
│ │ └─┬ through2@0.6.5
│ │   └── readable-stream@1.0.33
│ └── gulp-util@3.0.7
├─┬ gulp-flatten@0.1.1
│ └── gulp-util@3.0.7
├─┬ gulp-if@1.2.5
│ ├─┬ ternary-stream@1.2.3
│ │ ├─┬ merge-stream@0.1.8
│ │ │ └─┬ through2@0.6.5
│ │ │   └── readable-stream@1.0.33
│ │ └─┬ through2@0.6.5
│ │   └── readable-stream@1.0.33
│ └─┬ through2@0.6.5
│   └── readable-stream@1.0.33
├─┬ gulp-json-editor@2.2.1
│ ├── gulp-util@3.0.7
│ └─┬ through2@0.5.1
│   └── readable-stream@1.0.33
├─┬ gulp-minify-css@1.2.2
│ └── gulp-util@3.0.7
├─┬ gulp-ng-annotate@1.1.0
│ ├── gulp-util@3.0.7
│ └─┬ through2@0.4.2
│   └── readable-stream@1.0.33
├─┬ gulp-ng-constant@0.3.0
│ ├── lodash@2.4.2
│ └─┬ through2@0.4.2
│   └── readable-stream@1.0.33
├─┬ gulp-preprocess@1.2.0
│ └── lodash@2.4.2
├─┬ gulp-sass@1.3.3
│ ├── clone@0.1.19
│ ├── gulp-util@3.0.7
│ └─┬ node-sass@2.1.1
│   ├─┬ chalk@0.5.1
│   │ ├── ansi-styles@1.1.0
│   │ ├─┬ has-ansi@0.1.0
│   │ │ └── ansi-regex@0.2.1
│   │ ├── strip-ansi@0.3.0
│   │ └── supports-color@0.2.0
│   ├── cross-spawn@0.2.9
│   ├─┬ gaze@0.5.2
│   │ └─┬ globule@0.1.0
│   │   └── minimatch@0.2.14
│   ├─┬ mocha@2.3.4
│   │ ├── commander@2.3.0
│   │ ├── diff@1.4.0
│   │ ├── escape-string-regexp@1.0.2
│   │ ├─┬ glob@3.2.3
│   │ │ ├── graceful-fs@2.0.3
│   │ │ └── minimatch@0.2.14
│   │ ├── growl@1.8.1
│   │ ├─┬ jade@0.26.3
│   │ │ ├── commander@0.6.1
│   │ │ └── mkdirp@0.3.0
│   │ ├─┬ mkdirp@0.5.0
│   │ │ └── minimist@0.0.8
│   │ └── supports-color@1.2.0
│   ├── nan@1.9.0
│   ├─┬ npmconf@2.1.2
│   │ └── uid-number@0.0.5
│   ├── object-assign@2.1.1
│   ├─┬ pangyp@2.3.3
│   │ ├── glob@4.3.5
│   │ ├── graceful-fs@3.0.8
│   │ ├── minimatch@2.0.10
│   │ ├─┬ request@2.51.0
│   │ │ ├── aws-sign2@0.5.0
│   │ │ ├─┬ bl@0.9.4
│   │ │ │ └── readable-stream@1.0.33
│   │ │ ├── caseless@0.8.0
│   │ │ ├─┬ combined-stream@0.0.7
│   │ │ │ └── delayed-stream@0.0.5
│   │ │ ├── forever-agent@0.5.2
│   │ │ ├─┬ form-data@0.2.0
│   │ │ │ ├── async@0.9.2
│   │ │ │ └─┬ mime-types@2.0.14
│   │ │ │   └── mime-db@1.12.0
│   │ │ ├─┬ hawk@1.1.1
│   │ │ │ ├── boom@0.4.2
│   │ │ │ ├── cryptiles@0.2.2
│   │ │ │ ├── hoek@0.9.1
│   │ │ │ └── sntp@0.2.4
│   │ │ ├─┬ http-signature@0.10.1
│   │ │ │ ├── asn1@0.1.11
│   │ │ │ └── ctype@0.5.3
│   │ │ ├── mime-types@1.0.2
│   │ │ ├── oauth-sign@0.5.0
│   │ │ └── qs@2.3.3
│   │ └── tar@1.0.3
│   ├─┬ request@2.67.0
│   │ └─┬ har-validator@2.0.3
│   │   └── commander@2.9.0
│   └─┬ sass-graph@1.3.0
│     ├── commander@2.9.0
│     ├─┬ glob@4.5.3
│     │ └── minimatch@2.0.10
│     └── lodash@2.4.2
├─┬ gulp-shell@0.4.3
│ └── gulp-util@3.0.7
├─┬ gulp-uglify@1.5.1
│ └── gulp-util@3.0.7
├─┬ gulp-useref@1.3.0
│ ├── gulp-util@3.0.7
│ ├─┬ through2@0.6.5
│ │ └── readable-stream@1.0.33
│ └─┬ vinyl-fs@1.0.0
│   ├─┬ glob-stream@4.1.1
│   │ ├── glob@4.5.3
│   │ └── minimatch@2.0.10
│   ├── graceful-fs@3.0.8
│   └── object-assign@2.1.1
├─┬ gulp-util@2.2.20
│ ├─┬ chalk@0.5.1
│ │ ├── ansi-styles@1.1.0
│ │ ├─┬ has-ansi@0.1.0
│ │ │ └── ansi-regex@0.2.1
│ │ ├── strip-ansi@0.3.0
│ │ └── supports-color@0.2.0
│ └─┬ through2@0.5.1
│   └── readable-stream@1.0.33
├─┬ jshint@2.8.0
│ └── minimatch@2.0.10
└─┬ mv@2.1.1
  └─┬ mkdirp@0.5.1
    └── minimist@0.0.8

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\mocha\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Chase\Desktop\ionFullApp_1.3.0\node_modules\node-sass\package.json'
npm WARN ionfullapp@1.2.0 No repository field.
npm WARN ionfullapp@1.2.0 No license field.

非常感谢任何帮助。我完全陷入了困境。

3 个答案:

答案 0 :(得分:0)

我通过完全删除node_modules文件夹并使用npm install重新安装所有内容解决了这个问题

答案 1 :(得分:0)

你试过了吗:npm install node-gyp?

适用于使用sudo的Mac用户

抱歉,我无法发表评论

格尔茨

答案 2 :(得分:0)

答案很晚。但我尝试了以下内容,它对我有用。

sudo ionic setup sass