Advertisement
rodrigofbm

Untitled

Apr 12th, 2018
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. MEU package.json
  2. {
  3. "name": "umbler-node",
  4. "version": "1.0.0",
  5. "description": "",
  6. "main": "index.js",
  7. "scripts": {
  8. "start": "node App"
  9. },
  10. "author": "Rodrigo",
  11. "license": "ISC",
  12. "dependencies": {
  13. "bcryptjs": "^2.4.3",
  14. "body-parser": "^1.18.2",
  15. "check-node-version": "^2.1.0",
  16. "cluster": "^0.7.7",
  17. "connect-multiparty": "^2.1.0",
  18. "consign": "^0.1.6",
  19. "cors": "^2.8.4",
  20. "express": "^4.15.2",
  21. "express-validator": "^5.1.0",
  22. "jsonwebtoken": "^8.2.0",
  23. "mongodb": "^3.0.5",
  24. "mongoose": "^5.0.12",
  25. "os": "^0.1.1"
  26. }
  27. }
  28.  
  29.  
  30. onde acusa o erro de sintaxe:
  31.  
  32.  
  33.  
  34. userSchema.pre('save', async function(next) {
  35.  
  36. if(this.isModified('password')){
  37. const hash = await bcrypt.hash(this.password, 10);
  38.  
  39. this.password = hash
  40. next();
  41.  
  42. }else{
  43. next();
  44. }
  45.  
  46. })
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. 2018-04-12 15:53:06Z > node App
  54. 2018-04-12 15:53:06Z > umbler-node@1.0.0 start /usr/src/app
  55. 2018-04-12 15:53:06Z npm info it worked if it ends with ok
  56. 2018-04-12 15:53:06Z npm info lifecycle umbler-node@1.0.0~prestart: umbler-node@1.0.0
  57. 2018-04-12 15:53:06Z npm info lifecycle umbler-node@1.0.0~start: umbler-node@1.0.0
  58. 2018-04-12 15:53:06Z npm info using node@v6.11.3
  59. 2018-04-12 15:53:06Z npm info using npm@3.10.10
  60. 2018-04-12 15:53:07Z + ./app/controllers/noIMG.json
  61. 2018-04-12 15:53:07Z + ./app/controllers/produtosController.js
  62. 2018-04-12 15:53:07Z + ./app/controllers/userController.js
  63. 2018-04-12 15:53:07Z + ./app/models/auth.json
  64. 2018-04-12 15:53:07Z + ./app/models/produtosModel.js
  65. 2018-04-12 15:53:07Z + ./app/models/Schemas/produtosSchema.js
  66. 2018-04-12 15:53:07Z + ./app/models/Schemas/userSchema.js
  67. 2018-04-12 15:53:07Z + ./app/models/userModel.js
  68. 2018-04-12 15:53:07Z + ./app/routers/inicio.js
  69. 2018-04-12 15:53:07Z + ./app/routers/produtos.js
  70. 2018-04-12 15:53:07Z + ./app/routers/user.js
  71. 2018-04-12 15:53:07Z + ./config/dbConnection.js
  72. 2018-04-12 15:53:07Z consign v0.1.6 Initialized in /usr/src/app
  73. 2018-04-12 15:53:08Z
  74. 2018-04-12 15:53:08Z ^^^^^
  75. 2018-04-12 15:53:08Z at Consign.into (/usr/src/app/node_modules/consign/lib/consign.js:232:15)
  76. 2018-04-12 15:53:08Z at createScript (vm.js:56:10)
  77. 2018-04-12 15:53:08Z at Function.Module._load (module.js:438:3)
  78. 2018-04-12 15:53:08Z at Module._compile (module.js:542:28)
  79. 2018-04-12 15:53:08Z at Module._compile (module.js:570:32)
  80. 2018-04-12 15:53:08Z at Module.load (module.js:487:32)
  81. 2018-04-12 15:53:08Z at Module.require (module.js:497:17)
  82. 2018-04-12 15:53:08Z at Object.<anonymous> (/usr/src/app/config/server.js:40:6)
  83. 2018-04-12 15:53:08Z at Object.Module._extensions..js (module.js:579:10)
  84. 2018-04-12 15:53:08Z at Object.runInThisContext (vm.js:97:10)
  85. 2018-04-12 15:53:08Z at require (internal/module.js:20:19)
  86. 2018-04-12 15:53:08Z at tryModuleLoad (module.js:446:12)
  87. 2018-04-12 15:53:08Z /usr/src/app/app/models/Schemas/userSchema.js:23
  88. 2018-04-12 15:53:08Z npm ERR!
  89. 2018-04-12 15:53:08Z npm ERR! /usr/src/app/npm-debug.log
  90. 2018-04-12 15:53:08Z npm ERR! node App
  91. 2018-04-12 15:53:08Z npm ERR! npm bugs umbler-node
  92. 2018-04-12 15:53:08Z npm ERR! npm owner ls umbler-node
  93. 2018-04-12 15:53:08Z npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
  94. 2018-04-12 15:53:08Z npm ERR! code ELIFECYCLE
  95. 2018-04-12 15:53:08Z npm ERR! Exit status 1
  96. 2018-04-12 15:53:08Z npm ERR! Failed at the umbler-node@1.0.0 start script 'node App'.
  97. 2018-04-12 15:53:08Z npm ERR! If you do, this is most likely a problem with the umbler-node package,
  98. 2018-04-12 15:53:08Z npm ERR! Linux 4.4.0-116-generic
  99. 2018-04-12 15:53:08Z npm ERR! Make sure you have the latest version of node.js and npm installed.
  100. 2018-04-12 15:53:08Z npm ERR! node v6.11.3
  101. 2018-04-12 15:53:08Z npm ERR! not with npm itself.
  102. 2018-04-12 15:53:08Z npm ERR! npm v3.10.10
  103. 2018-04-12 15:53:08Z npm ERR! Or if that isn't available, you can get their info via:
  104. 2018-04-12 15:53:08Z npm ERR! Please include the following file with any support request:
  105. 2018-04-12 15:53:08Z npm ERR! Tell the author that this fails on your system:
  106. 2018-04-12 15:53:08Z npm ERR! There is likely additional logging output above.
  107. 2018-04-12 15:53:08Z npm ERR! umbler-node@1.0.0 start: `node App`
  108. 2018-04-12 15:53:08Z npm ERR! You can get information on how to open an issue for this project with:
  109. 2018-04-12 15:53:08Z npm info lifecycle umbler-node@1.0.0~start: Failed to exec start script
  110. 2018-04-12 15:53:08Z SyntaxError: missing ) after argument list
  111. 2018-04-12 15:53:08Z userSchema.pre('save', async function(next) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement