Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

yeoman generator and npm errors #7349

Closed
davicho opened this issue Feb 12, 2015 · 69 comments
Closed

yeoman generator and npm errors #7349

davicho opened this issue Feb 12, 2015 · 69 comments

Comments

@davicho
Copy link

davicho commented Feb 12, 2015

New to this node game and I think this is where I need to be.

I have installed both an angular generator and webapp (2 diff projects, the webapp is a query tutorial) and get NPM errors. Focusing on the webapp, first errors:

npm WARN package.json lynda-jquery-essential@ No description
npm WARN package.json lynda-jquery-essential@ No repository field.
npm WARN package.json lynda-jquery-essential@ No README data
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.0

npm ERR! null == true
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

more fetching and installing then this error:

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/darivera/Documents/BUSINESS/veecho/web_v1/web/code/lynda-jquery-essential/test/npm-debug.log

And lastly when I run grunt serve this error:

Loading "autoprefixer.js" tasks...ERROR
>> Error: Cannot find module 'postcss'

Running "serve" task
Warning: Task "autoprefixer" not found. Use --force to continue.

Aborted due to warnings.

FYI: I am pretty sure I installed node thru brew. Can't remember if I did globally (how can I tell? does it matter?). I keep reading about changing permissions on some files and that it is a bug. Funny thing is that angular generator would run "grunt serve" (still with some errors but it would run) BUT the webapp, you'd think it would run - doesn't.

Thx.

@davicho
Copy link
Author

davicho commented Feb 12, 2015

Well after much trial and error and git issue and stack overflow reads it seems that somewhere along the way I used:

sudo chown -R `whoami` ~/.npm

Now initially this did not work even after restarting the terminal. I restarted my computer for some other reason and now all is dandy - no errors. Food for thought.

I still do wonder if this is a bug.

@othiym23
Copy link
Contributor

npm ERR! null == true

is a rare error message that crops up from time to time and comes from somewhere deep in the guts of the Node OpenSSL bindings. It's a failed assert, but it could really use some additional context saying what's going on.

It sounds like you got past that, though, so I'm going to go ahead and close this as resolved. Good luck on your various Node / npm / web development adventures!

@Webber89
Copy link

Webber89 commented Mar 5, 2015

I get the same error as davicho after running 'yo angular'. Only thing different i see, is the npm version.
screen shot 2015-03-05 at 18 42 32

Before getting this error it creates a bunch of stuff, a few warnings which seems to come from version difference, then this error. It continues with bower, then i get this error:
screen shot 2015-03-05 at 18 49 17

It continues, setting everything up, but then i get the first error twice. Then more work done, some warnings, which doesn't look to matter either, some testing, more errors in the form of:
screen shot 2015-03-05 at 18 52 21

Then it runs wiredep:app and wiredep:test, and finally says "done, without errors".

Then when i try to run 'grunt serve' it gives me this:
screen shot 2015-03-05 at 20 45 40

I tried restarting my computer, but that didn't help anything.. Let me know if more information is needed. I don't normally use terminal.. Thanks

@othiym23
Copy link
Contributor

othiym23 commented Mar 5, 2015

It's useful to know that this affects OS X as well as Windows users. There could be something slightly thingy going on with the SSL code in 0.12.0, but that's out of my area of competency. @indutny, does this ring any bells with you? The only other time I've seen null == true coming out of the guts of Node, it's been a TLS issue.

@indutny
Copy link

indutny commented Mar 5, 2015

null == true sounds very vague, is there any way to get a stack trace or something like that? Never seen this error in core before.

@othiym23
Copy link
Contributor

othiym23 commented Mar 5, 2015

That's the thing – it comes without a stack trace, and it's not coming from npm itself. It appears to only be happening on 0.12.0, and I haven't gotten any reports from io.js users encountering this yet.

@othiym23
Copy link
Contributor

othiym23 commented Mar 6, 2015

See also #7306, #7332, #7555 -- at first I was dead sure this was a node core bug (only Node 0.12.0 and not 0.10.x or io.js users are seeing this crash), but now I'm not so sure, especially because I realized last night that I haven't seen an npm-debug.log from anyone and therefore haven't verified that there's no stack trace to investigate here. The first person to give a stacktrace gets a prize, which is my thanks and gratitude (a super-valuable prize!).

@othiym23 othiym23 reopened this Mar 6, 2015
@othiym23
Copy link
Contributor

othiym23 commented Mar 6, 2015

@indutny yay I have a stacktrace (this one courtesy @cibulka, to whom I am very thankful):

104310 verbose stack AssertionError: null == true
104310 verbose stack     at TLSSocket.socketOnData (_http_client.js:308:3)
104310 verbose stack     at TLSSocket.emit (events.js:107:17)
104310 verbose stack     at TLSSocket.Readable.read (_stream_readable.js:373:10)
104310 verbose stack     at TLSSocket.socketCloseListener (_http_client.js:229:10)
104310 verbose stack     at TLSSocket.emit (events.js:129:20)
104310 verbose stack     at TCP.close (net.js:476:12)

No, I have two stacktraces! (this one from @mattia-pink, thank you very much!)

102672 verbose stack AssertionError: null == true
102672 verbose stack     at TLSSocket.socketOnData (_http_client.js:308:3)
102672 verbose stack     at TLSSocket.emit (events.js:107:17)
102672 verbose stack     at TLSSocket.Readable.read (_stream_readable.js:373:10)
102672 verbose stack     at TLSSocket.socketCloseListener (_http_client.js:229:10)
102672 verbose stack     at TLSSocket.emit (events.js:129:20)
102672 verbose stack     at TCP.close (net.js:476:12)

Wasn't there an issue with something overwriting the HTTP parser's socket due to bad error-handling that was fixed in io.js a couple weeks ago?

@indutny
Copy link

indutny commented Mar 6, 2015

@othiym23 at least I'm not aware of this issue :) From which io.js version is this stack trace? It seems that the assertion has moved to different line in a recent io.js versions.

@othiym23
Copy link
Contributor

othiym23 commented Mar 6, 2015

@indutny Everyone seeing this issue is on Node.js 0.12.0. Sorry for not being clearer, and thanks for your eyes on this! I created an issue over there.

@indutny
Copy link

indutny commented Mar 6, 2015

Aaah, node.js 0.12, sorry! :)

@indutny
Copy link

indutny commented Mar 6, 2015

I'm just splitting my mind between two issues and got a bit lost :)

@cibulka
Copy link

cibulka commented Mar 6, 2015

I've noticed that several other people from related issues were using https://github.com/postcss/postcss. Personally, I am using:

When I removed grunt-pixrem from my package.json, npm install works as expected. So if that helps ...

@mattia-pink
Copy link

@cibulka I think you are right, I have this problem trying to use the sage theme https://roots.io/sage/

and when I run gulp I have this error:
[14:39:25] Error: Cannot find module 'postcss'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/user/Desktop/sage3/sage/node_modules/gulp-pleeease/node_modules/pleeease/lib/pleeease.js:5:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478: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)

but I have no idea how can i go ahead about this.
somebody can help me to understand?
thanks

@indutny
Copy link

indutny commented Mar 6, 2015

One more thing, if anyone is able to reproduce this issue, could you please do this with NODE_DEBUG=net environment variable and paste the output here? It would help a lot!

@cibulka
Copy link

cibulka commented Mar 6, 2015

@indutny - I can definitely reproduce the issue if I'm using grunt-pixrem. So in terms of a Node rookie, how do I change NODE_DEBUG variable? npm update NODE_DEBUG=net does nothing.

@cibulka
Copy link

cibulka commented Mar 6, 2015

@mattia-pink - Root's Sage is using iamvdo/pleeease, which has https://github.com/robwierzbowski/grunt-pixrem dependency as well. I'm not sure how much is Sage's workflow dependent on that, but try to remove it and see if you can work with that.

@othiym23
Copy link
Contributor

othiym23 commented Mar 6, 2015

@cibulka NODE_DEBUG=net npm install

@cibulka
Copy link

cibulka commented Mar 6, 2015

@othiym23: Thanks. :) I'm on it!

@mattia-pink
Copy link

@othiym23 , i tried NODE_DEBUG=net npm install and this is the result

users-imac-3:sage user$ NODE_DEBUG=net npm install
npm WARN unmet dependency /Users/user/Desktop/sage3/sage/node_modules/gulp-pleeease/node_modules/pleeease requires deep-extend@'~0.2.8' but will load
npm WARN unmet dependency /Users/user/Desktop/sage3/sage/node_modules/deep-extend,
npm WARN unmet dependency which is version 0.3.2

what can i do?

@cibulka
Copy link

cibulka commented Mar 6, 2015

I feel like an idiot - I can no longer reproduce the issue with npm install - even with grunt-pixrem package included (if that package caused the problem in the first place). Should i still send the output with NODE_DEBUG=net set?

Another problem I haven't before appeared though. I have no idea if it is related, but my Grunt task for https://github.com/SassDoc/sassdoc suddenly started to fail. Pasting the output with grunt --verbose in case it is related in some way:

Loading "grunt-sassdoc" plugin

Registering "/Users/Cibulka/Documents/_00-Web-WP/tvar.dev/web/app/themes/cibulka-wp-theme/node_modules/grunt-sassdoc/tasks" tasks.
Loading "sassdoc.js" tasks...ERROR
>> TypeError: undefined is not a function
>>     at /Users/Cibulka/Documents/_00-Web-WP/tvar.dev/web/app/themes/cibulka-wp-theme/node_modules/grunt-sassdoc/node_modules/sassdoc/dist/errors.js:15:17
>>     at Object.<anonymous> (/Users/Cibulka/Documents/_00-Web-WP/tvar.dev/web/app/themes/cibulka-wp-theme/node_modules/grunt-sassdoc/node_modules/sassdoc/dist/errors.js:25:3)
>>     at Module._compile (module.js:460:26)
>>     at Object.Module._extensions..js (module.js:478: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 Object.<anonymous> (/Users/Cibulka/Documents/_00-Web-WP/tvar.dev/web/app/themes/cibulka-wp-theme/node_modules/grunt-sassdoc/node_modules/sassdoc/dist/environment.js:9:51)
>>     at Module._compile (module.js:460:26)
Warning: Task "sassdoc" failed. Use --force to continue.

@othiym23
Copy link
Contributor

othiym23 commented Mar 6, 2015

@cibulka Don't feel like an idiot – I'm pretty sure this is a race condition, and by their nature, these are intermittent bugs. Your debug log was very helpful!

@mattia-pink Try rerunning the install that failed (whatever command that was) with NODE_DEBUG=net prefixed before the command. You might also try running npm cache clean first, so that npm has to download all the dependencies again, which will increase the likelihood of exercising the bug.

@misterdjules
Copy link

@mchung @cibulka @haxzorer and anyone who encountered this issue:

Do you have some time to build this branch of my joyent/node's fork that contains a candidate for a fix: https://github.com/misterdjules/node/tree/fix-npm-assert and let us know if you can reproduce the bug?

You will probably need to pass --nodedir=/dir/where/you/checkedout/this/branch to npm install and maybe to the yo command too (not sure how that works).

If building this branch and passing --nodedir is not convenient, I can also provide you with an installer/binary for any supported operating system (OSX, Windows, Linux and SmartOS) that will not require you to do that.

Thank you!

@cibulka
Copy link

cibulka commented Mar 19, 2015

@misterdjules I would love to help, but I can't reproduce the error anymore and most importantly, as I am a very basic npm install || npm update user, your instructions sound a little bit greek to me ...

Also, this issue is a master for #7555, so I am not a user of Yeoman.

@misterdjules
Copy link

@cibulka Thank you for your response :) If you are able to reproduce this bug at some point in the future, please let me know and I'll provide you with better instructions for how to test the candidate fix I mentioned earlier.

@intelligence
Copy link

@misterdjules I'm experiencing the said bug. I'm a basic user aswell so some help to get the candidate fix in place would be great!

@misterdjules
Copy link

@intelligence Are you able to reproduce it reliably? If so, what OS do you run node on?

@intelligence
Copy link

@misterdjules Yes, it happens every time I try to run npm install.

I've tried multiple times just with rm -rf node_modules/ && npm cache clean.
I've also tried rebooting and running npm config set registry http://registry.npmjs.org/ as @haxzorer suggested. I'm also on OS X 10.9.5 and with npm version 2.7.1, same as him.

@indutny
Copy link

indutny commented Mar 23, 2015

@misterdjules sorry to ask, but what are trying to figure out by this? The fix surely applies to the problem mentioned in this issue. If testing anything - I'd suggest doing it in a different way.

@intelligence may I ask you to give a try to the patch from the comment?

@intelligence
Copy link

@indutny I would if I could, hehe. Don't know how to build..

@indutny
Copy link

indutny commented Mar 23, 2015

@intelligence it is easy! :) Let me help with this.

git clone -b fix-npm-assert git://github.com/misterdjules/node --depth 1
cd node
./configure --prefix=/tmp/node-fix-test
make -j9
make install
export PATH="/tmp/node-fix-test/bin:$PATH"

Now you could try cding into your project directory and running npm in it. Please use the same terminal, as we have modified the PATH for it to make it use fixed node.js version.

@misterdjules
Copy link

@indutny I'm trying to make sure that misterdjules/node@e0059cd fixes this issue.

What would you suggest doing differently?

The reason why I offered to provide an installer/binary to @intelligence is that it's easier than requiring him/her to setup a development environment, which he/she might not be able to do for various reasons.

@indutny
Copy link

indutny commented Mar 23, 2015

@misterdjules I'd suggest just doing a release with this patch. It fixes some issue for sure, and very likely fixing this issue too (as I believe they are the same).

@misterdjules
Copy link

@indutny There's no doubt the fix will make it into v0.12.2, as I indicated in this comment: nodejs/node-v0.x-archive#9348 (comment). Like I said, I just want to turn "very likely" into "100% sure".

@intelligence
Copy link

@indutny Thanks! I was able to get it working, but npm install is complaining about my gulp version (3.4.0 in 0.12.1-pre "mode"): notarget No compatible version found: gulp@'>=3.8.10 <4.0.0'and I can't seem to upgrade it with this node version. If I restart my terminal I'm at 3.8.11.

Error messages in terminal is:

$ npm install -g gulp@3.8.11
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/tmp/node-fix-test/bin/npm" "install" "-g" "gulp@3.8.11"
npm ERR! node v0.12.1-pre
npm ERR! npm  v2.7.4
npm ERR! code ENOTSUP

npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your version of node/npm: gulp@3.8.11
npm ERR! notsup Required: {"node":">= 0.9"}
npm ERR! notsup Actual:   {"npm":"2.7.4","node":"0.12.1-pre"}

Edit: Was able to get gulp to 3.8.11 with --force. Rerunning npm installstill gives me error notarget No compatible version found: gulp@'>=3.8.10 <4.0.0' full log here: http://pastebin.com/9mJR7uET

$ gulp -v
[22:46:04] CLI version 3.8.11

@graywithanA
Copy link

Hello,
I too am getting a null == true error message. I get the error a couple times when running yo angular. I'm running node 0.12.1 and npm 2.5.1 on OSX 10.9.5.

Here's the error in full:

npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1

npm ERR! null == true
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! http://github.com/npm/npm/issues

It's worth noting that although the errors occur every time i run yo angular, an npm-debug.log is only generated sometimes. Also, the location and number of null == true errors seems to vary. The error always seems to occur after the line karma-jasmine@0.3.5 node_modules/karma-jasmine and ofter soon after jquery#2.1.3 bower_components/jquery

Here's the log content: https://gist.github.com/graywithanA/07df0b6f328b5eb384df
And in case it's helpful here's the terminal output: https://gist.github.com/graywithanA/e3f7f8814cb39b15ca01

Let me know if there is anything else you need that would be helpful.

@othiym23
Copy link
Contributor

This problem will not be fixed in Node.js until 0.12.2 @graywithanA. If it's blocking you, you might want to take a look at using a recent version of io.js until Node.js 0.12.2 is released.

@intelligence
Copy link

Just a heads up, if you're using node-sass, it won't work with io.js 1.6.2.

@misterdjules
Copy link

@intelligence @graywithanA I built a node OSX installer that includes node v0.12.0 + the candidate fix for this issue. If you had some time to give it a try and let us know if that fixes this issue for you, that would be great.

The package is not signed, so you might get a warning when opening it.

Thank you!

@graywithanA
Copy link

@misterdjules Do I need to remove my current node installation before running your pkg or will this overwrite my existing installation?

If I need to remove the current installation is the process outlined here sufficient?

Also, if this doesn't fix the issue then downgrading to 0.10.x should correct? If there a preferred 0.10.x version?

@misterdjules
Copy link

@graywithanA The installer will override any node binary in /usr/local/bin/node, so there's no need to remove your current node installation.

If it doesn't fix your issue, using node v0.10.x should fix it. Node v0.10.38 is the latest and recommended Node.js version.

@graywithanA
Copy link

@misterdjules Your fix appears to have worked for me. Thank you. I was able to run yo angular without any errors occurring during the process.

I did receive an error indicating the Compass wasn't installed in Ruby when attempting to run grunt serve but I'm not sure if this is a related issue:

Running "concurrent:server" (concurrent) task
    Warning: Running "compass:server" (compass) task
    Warning: Command failed: compass --version
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 66 total gem(s) (Gem::LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
        from /usr/bin/compass:22:in `<main>'
     Use --force to continue.

    Aborted due to warnings.

I don't know if yo-angular is supposed to install Compass if it isn't already present although I doubt it. That being said it would be nice if the generator-angular documentation indicated you need to install it yourself if you want to utilize the generator's SASS/Compass option. Either way, manually installing Compass after updating gem made the error go away and allowed me to successfully startup the grunt server.

All seems to be working well now.

@misterdjules
Copy link

@graywithanA Thank you for all your help in making sure that this issue is fixed, and thanks to @indutny for fixing the issue in the first place 👍

@intelligence
Copy link

Works fine over here aswell! Just need to sudo stuff for now, but that'll do until I can install with nvm :)

Thanks!

@graywithanA
Copy link

@intelligence I'm using the second option suggested here to avoid the sudo issue and it works great.

@vkbr
Copy link

vkbr commented May 25, 2016

I had spaces in "name" field in package.json. Removing that fixed the problem.

@npm-robot
Copy link

We're closing this issue as it has gone thirty days without activity. In our experience if an issue has gone thirty days without any activity then it's unlikely to be addressed. In the case of bug reports, often the underlying issue will be addressed but finding related issues is quite difficult and often incomplete.

If this was a bug report and it is still relevant then we encourage you to open it again as a new issue. If this was a feature request then you should feel free to open it again, or even better open a PR.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests