I'm having trouble using yeoman to generate an angular application.
Yeoman appears to be doing its part fine, but when it comes to bower install && npm install, it fails when running the OptiPNG tests.
I'm running OSX 10.8.3, Node version 0.8.18, and the latest versions of NPM and yeoman.
> optipng-bin@0.2.5 postinstall /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node pre-build.js
> jpegtran-bin@0.1.7 postinstall /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node pre-build.js
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
✖ 4 of 3 tests failed:
1) OptiPNG should return path to OptiPNG binary:
AssertionError: false == true
at args (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:18:4)
at ChildProcess.exithandler (child_process.js:544:7)
at ChildProcess.EventEmitter.emit (events.js:99:17)
at maybeClose (child_process.js:638:16)
at Process._handle.onexit (child_process.js:680:5)
2) OptiPNG should successfully proxy OptiPNG:
AssertionError: false == true
at args (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:27:4)
at ChildProcess.exithandler (child_process.js:544:7)
at ChildProcess.EventEmitter.emit (events.js:99:17)
at maybeClose (child_process.js:638:16)
at Process._handle.onexit (child_process.js:680:5)
3) OptiPNG should minify a .png:
Error: ENOENT, no such file or directory 'test/minified.png'
at Object.fs.statSync (fs.js:524:18)
at /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:43:20
at ChildProcess.exithandler (child_process.js:544:7)
at ChildProcess.EventEmitter.emit (events.js:99:17)
at maybeClose (child_process.js:638:16)
at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.destroyed (net.js:358:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
4) OptiPNG "after all" hook:
Error: ENOENT, no such file or directory 'test/minified.png'
at Object.fs.unlinkSync (fs.js:582:18)
at Context.binPath (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:11:6)
at Hook.Runnable.run (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/mocha/lib/runnable.js:213:32)
at next (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/mocha/lib/runner.js:243:10)
at Runner.hook (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/mocha/lib/runner.js:254:5)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
pre-build test failed, compiling from source...
Fetching http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.4/optipng-0.7.4.tar.gz...
3 tests complete (232 ms)
pre-build test passed successfully, skipping build...
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/ncp
npm http 304 https://registry.npmjs.org/i
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm WARN prefer global bower@0.9.2 should be installed with -g
npm http 304 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/sigmund
> ws@0.4.25 install /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-karma/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/inherits
Done in /var/folders/jn/g1mkc1bx7090cm6269r6sbm40000gp/T/optipng-0.7.4
Building OptiPNG...
/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/build.js:64
throw err;
^
Error: Command failed:
at ChildProcess.exithandler (child_process.js:540:15)
at ChildProcess.EventEmitter.emit (events.js:99:17)
at maybeClose (child_process.js:638:16)
at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.destroyed (net.js:358:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
npm ERR! weird error 1
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
npm ERR! not ok code 0
I am not sure if this will help... but I recently had similar errors with optipng and jpegtran when using the angular generator in yo
. (Note: I wasn't testing on OSX at the time - but rather windows. But I think the issue is the same based on my recollection of the errors.)
The problem was that I updated to the latest yo
and some residual things remained in my npm cache. The following fixed things:
npm uninstall -g yeoman
npm install -g yo
npm cache clean
npm update -g yo
After I did this, I tested yo angular
in a clean directory, and the scaffolding was created without errors.
我有一个类似的问题,并尝试在我的项目目录的根目录中运行“bower cache clean”的各种事情解决了它。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.