Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp test for new project throwing error #2628

Closed
1 task done
nstuyvesant opened this issue Sep 1, 2017 · 2 comments · Fixed by #2629
Closed
1 task done

gulp test for new project throwing error #2628

nstuyvesant opened this issue Sep 1, 2017 · 2 comments · Fixed by #2629
Assignees
Labels

Comments

@nstuyvesant
Copy link
Contributor

  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 4.2.2
Node 8.4.0
npm 5.3.0
Operating System OS X 10
Item Answer
Transpiler Babel
Markup Pug
CSS SCSS
Router ngRoute
Client Tests Mocha
DB SQL
Auth Y

Got this error after scaffolding a project and running gulp test:

events.js:182
      throw er; // Unhandled 'error' event
      ^
TypeError: The "digest" argument is required and must not be undefined
  at pbkdf2 (crypto.js:635:11)
  at Object.exports.pbkdf2 (crypto.js:623:10)
  at Instance.encryptPassword (/Users/nates/dev/test/server/api/user/user.model.js:187:33)
  at /Users/nates/dev/test/server/api/user/user.model.js:219:18
  at RandomBytes.ondone (/Users/nates/dev/test/server/api/user/user.model.js:160:18)

Seems like the function calls on line 183 of user.model(sequelizeModels).js and line 187 need to specify the digest for newer versions of node.

@Awk34
Copy link
Member

Awk34 commented Sep 1, 2017

Correct. Node used to default it to 'sha1', so if you already have passwords hashed, use that option. Otherwise you can run node --print --eval "require('crypto').getHashes()" in a console to see a list of hashing algorithms that your current version supports. We should set it to 'sha1' in version 4.x.x so that it doesn't break anyone, and also set a new default in the canary branch for 5.0.0. The new Node docs show 'sha512' in the examples.

@Awk34 Awk34 self-assigned this Sep 1, 2017
@nstuyvesant
Copy link
Contributor Author

Makes sense - thanks!

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

Successfully merging a pull request may close this issue.

2 participants