沒有大量的吞噬經驗,這可能是我的一個簡單的錯誤,但我一直無法找到一種可以在任何地方在線工作的解決方案...希望堆棧溢出可以救我!運行任務時出現的各種錯誤(吞吐圖片/ scss生成器)
我正在嘗試使用節點插件的sprity創建spritesheet和關聯的SASS(.scss)樣式表。 https://www.npmjs.com/package/sprity
我已經安裝了sprity和sprity-sass(以及gulp-sass和其他我已經使用過的)。我在安裝過程中有一些錯誤的 - 不知道這些是當前問題的原因,或如何去修復它們(我想我可能已經解決了一些,見下文)
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/sprity-lwip/node_modules/lwip
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
有有我已經在另外安裝固定的各種錯誤:
lwip (fixed error [10:27:09] Error: PluggableError: lwip not found.) - this generated multiple warnings.
gulp-if (fixed to error Error: Cannot find module 'gulp-if')
當我運行一飲而盡精靈,我得到的開始「精靈」的消息,然後各種錯誤:
Error: Unknown arguments configuration,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
at Error (native)
at /Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/lwip/node_modules/decree/dist/cjs/decree.js:80:27
at Object.create (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/lwip/lib/obtain.js:66:33)
at renderSprite (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/lib/sprite.js:47:17)
at createSprite (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/lib/sprite.js:81:13)
at DestroyableTransform._transform (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/lib/sprite.js:124:9)
at DestroyableTransform.Transform._read (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at write (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/Users/roxy/Dropbox/Shared Sites/CavendishResidential/node_modules/sprity/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:67:13)
at DestroyableTransform.emit (events.js:166:7)
相關SE我gulpfile的ctions是:
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var sass = require('gulp-sass');
var gulpif = require('gulp-if');
var sprity = require('sprity');
// generate sprite.png and _sprite.scss
gulp.task('sprites', function() {
return sprity.src({
src: './img/sprites/**/*.{png,jpg}',
style: './sass/_sprites.scss',
// ... other optional options
// for example if you want to generate scss instead of css
processor: 'sass'
//'style-type': 'scss' // make sure you have installed sprity-sass
})
.pipe(gulpif('*.png', gulp.dest('./img/'), gulp.dest('./css/')))
});
取消註釋風格類型的生產線生產不同的錯誤:
'style-type': 'scss' // make sure you have installed sprity-sass
^^^^^^^^^^^^
SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:192:16)
at module.exports (/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)
我已經安裝了sprity,青菜和運行NPM sprity - 薩斯-v返回一個版本號(2.14.4),所以不知道爲什麼我收到這條消息?或者「意外的字符串」消息指的是什麼?
我已經驗證,有兩個至少一個圖像文件/ IMG /精靈和/ IMG /精靈/ somefolder
我在Mac OSX上約塞米蒂v 10.10.5(14F27) - 這只是添加到混亂,我是新來的(用於使用Windows!)
謝謝,給我解決了! –