taylonr / postman

MIT License
110 stars 237 forks source link

I am also having the same issue, i'm not sure maybe it is due to the fact that i did not change my password in confiq file but please can you help #10

Closed kennyagboola closed 4 years ago

kennyagboola commented 4 years ago

Yeah, it must be something on your environment. I just pulled latest, and spun up a psql DB, set my password to "secret" and tried it, and the database was created without issue.

I know that people have done the course on Windows, so I'm kind of at a loss for why it's not working for youl

Originally posted by @taylonr in https://github.com/taylonr/postman/issues/2#issuecomment-385128020

taylonr commented 4 years ago

What error are you getting?

kennyagboola commented 4 years ago

postman@0.0.0 db:create:test C:\Users\Kenny\Desktop\PostmanProject\postman cross-env NODE_ENV=test ./node_modules/.bin/sequelize db:create && cross-env NODE_ENV=test npm run db:migrate && cross-env NODE_ENV=test npm run db:seed

'cross-env' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! postman@0.0.0 db:create:test: cross-env NODE_ENV=test ./node_modules/.bin/sequelize db:create && cross-env NODE_ENV=test npm run db:migrate && cross-env NODE_ENV=test npm run db:seed npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the postman@0.0.0 db:create:test script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Kenny\AppData\Roaming\npm-cache_logs\2019-12-11T18_10_50_202Z-debug.log

C:\Users\Kenny\Desktop\PostmanProject\postman>

taylonr commented 4 years ago

Have you run npm install?

kennyagboola commented 4 years ago

I have but i can run it again

This is what my confiq file look like

{ "development": { "username": "postgres", "password": null, "database": "postman_dev", "host": "localhost", "port": 5432, "dialect": "postgres" }, "test": { "username": "postgres", "password": null, "database": "postman_test", "host": "localhost", "port": 5432, "dialect": "postgres" } }

taylonr commented 4 years ago

The error you're getting is "'cross-env' is not recognized as an internal or external command,"

cross-env is an npm package. If running npm-install does not work, try installing it individually npm i -d cross-env

kennyagboola commented 4 years ago

Hi Taylor Below is the error I'M getting after install npm i -d cross-env Error: spawn node_modules.bin\sequelize ENOENT at notFoundError (C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules\cross-spawn\lib\enoent.js:6:26) at verifyENOENT (C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules\cross-spawn\lib\enoent.js:40:16) at ChildProcess.cp.emit (C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules\cross-spawn\lib\enoent.js:27:25) at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) Emitted 'error' event at: at ChildProcess.cp.emit (C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules\cross-spawn\lib\enoent.js:30:37) at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! postman@0.0.0 db:create:test: `cross-env NODE_ENV=test ./node_modules/.bin/sequelize db:create && cross-env NODE_ENV=test npm run db:migrate && cross-env NODE_ENV=test np

taylonr commented 4 years ago

can you try deleting your node_modules folder (C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules) and then run npm install again from C:\Users\Kenny\Desktop\PostmanProject\postman?

kennyagboola commented 4 years ago

it still says i have npm 6.9 after deleting the node_module

taylonr commented 4 years ago

Ok, now run npm install and let me know if there are any errors.

kennyagboola commented 4 years ago

This i9s the error i now get

core-js@2.6.11 postinstall C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules\core-js node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

nodemon@1.19.4 postinstall C:\Users\Kenny\Desktop\PostmanProject\postman\node_modules\nodemon node bin/postinstall || exit 0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1006 packages from 950 contributors and audited 882187 packages in 58.953s found 33 vulnerabilities (8 low, 3 moderate, 19 high, 3 critical) run npm audit fix to fix them, or npm audit for details

taylonr commented 4 years ago

I don't actually see an error there. I seek a warning for an optional dependency which is ok.

If you run the "db:create:test" command now are you getting any errors.

kennyagboola commented 4 years ago

I got this C:\Users\Kenny\Desktop\PostmanProject\postman>npm run db:create:test

postman@0.0.0 db:create:test C:\Users\Kenny\Desktop\PostmanProject\postman cross-env NODE_ENV=test ./node_modules/.bin/sequelize db:create && cross-env NODE_ENV=test npm run db:migrate && cross-env NODE_ENV=test npm run db:seed

Sequelize CLI [Node: 10.16.3, CLI: 3.2.0, ORM: 4.44.3]

WARNING: This version of Sequelize CLI is not fully compatible with Sequelize v4. https://github.com/sequelize/cli#sequelize-support

Loaded configuration file "server\config\config.json". Using environment "test". sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules\sequelize\lib\sequelize.js:245:13 Database postman_test created.

postman@0.0.0 db:migrate C:\Users\Kenny\Desktop\PostmanProject\postman sequelize db:migrate

Sequelize CLI [Node: 10.16.3, CLI: 3.2.0, ORM: 4.44.3]

WARNING: This version of Sequelize CLI is not fully compatible with Sequelize v4. https://github.com/sequelize/cli#sequelize-support

Loaded configuration file "server\config\config.json". Using environment "test". sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules\sequelize\lib\sequelize.js:245:13 == 20170821002306-create-account: migrating ======= == 20170821002306-create-account: migrated (0.029s)

== 20170830004512-create-book: migrating ======= == 20170830004512-create-book: migrated (0.018s)

== 20170830004814-create-household: migrating ======= == 20170830004814-create-household: migrated (0.016s)

== 20170830005147-create-user: migrating ======= == 20170830005147-create-user: migrated (0.026s)

== 20171011010437-create-wishlist: migrating ======= == 20171011010437-create-wishlist: migrated (0.022s)

postman@0.0.0 db:seed C:\Users\Kenny\Desktop\PostmanProject\postman sequelize db:seed:all

Sequelize CLI [Node: 10.16.3, CLI: 3.2.0, ORM: 4.44.3]

WARNING: This version of Sequelize CLI is not fully compatible with Sequelize v4. https://github.com/sequelize/cli#sequelize-support

Loaded configuration file "server\config\config.json". Using environment "test". sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules\sequelize\lib\sequelize.js:245:13 File: data does not match pattern: /.js$/ File: data does not match pattern: /.js$/ File: data does not match pattern: /.js$/ == 20170821010043-init: migrating ======= == 20170821010043-init: migrated (0.017s)

== 20170830010805-add-books: migrating ======= == 20170830010805-add-books: migrated (0.008s)

C:\Users\Kenny\Desktop\PostmanProject\postman>

taylonr commented 4 years ago

So looks like you now have a test database set up in your postgres.

That is, that looks to be a successful run, so I think you should be good to go.

kennyagboola commented 4 years ago

Thanks Taylonr for all the help, I really grateful. It is all now setup