sql-fundamentals icon indicating copy to clipboard operation
sql-fundamentals copied to clipboard

Windows Installation

Open MadeByJay opened this issue 6 years ago • 9 comments

Hi, having a issue with installation on windows 10. Added the DLLs, to system, I think, and tried to run the scripts and such. But there are errors everywhere, so I know I didn't install all the components required for this code base right on some level. Like, I can't even get the mysql installation test code to run, says mysqlshow or whatever can't be found. Spent a few hours debugging and now I'm just lost.

Also, visual studio code is telling me it can't find a lot of the modules declared in our code

Now, while I would like, and definitely need help with this, this is also the second time I've run into this rather huge issue in one of your courses. The other was the PWA course. Great material, and you're a great teacher of things, but I can only passively follow along because my code doesn't work. And there's no actual video running through the installation of these complex parts. In both videos it feels like you just gloss over it at high levels, and assume we'll get it right. I don't, I'm kind of an idiot, that's why I'm taking your course. So please help me out.

I know you're a mac developer and that it's rather tedious to kind of prepare both examples, but as a windows user, a large chunk of the value your course offers is now kind of lost to me, because I can't practically follow along.

MadeByJay avatar Apr 12 '18 21:04 MadeByJay

@ThunderGawd - One of the things that's difficult about workshops that require native software is that every developer's system is a little different, and the installation instructions that work for one windows 10 user don't work for another. I do make sure that my instructions are correct for a fresh windows installation.

Which database server(s) did you attempt to set up (MySQL, SQLite, PostgreSQL)?

Since you're talking about DLLs we're probably talking about SQLite. I'd encourage you to give one of the other two a shot. They have more typical install processes (i.e., an installer program that does the work for you).

Let me know how you fare. I'm committed to making sure as many people can benefit from this material as possible, even if I have to build you a VirtualBox virtual machine that's already set up and ready to go (this would be Linux, since I can't give away Windows 10 installations).

mike-north avatar Apr 13 '18 05:04 mike-north

I also have trouble setting up postgresql database on windows 10. I use Git bash to run scripts/db/setup/pg.sh but I'm getting lots of stange errors:

\033[0;32mSetting Up PostgreSQL Database. This may take a few minutes...\033[0m \033[1;33m - Removing any existing northwind database (if this hangs: "killall -9 psql")\033[0m dropdb: ▒▒ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒▒▒▒ template1: FATAL: role "yanza" does not exist \033[1;33m - Removing any existing northwind_user user\033[0m dropuser: ▒▒ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒▒▒▒ postgres: FATAL: role "yanza" does not exist \033[1;33m - Creating northwind database\033[0m createdb: ▒▒ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒▒▒▒ template1: FATAL: role "yanza" does not exist \033[1;33m - Ensuring plpgsql extension is installed\033[0m psql: ▒▒▒▒▒▒▒▒▒▒▒▒▒▒: ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒ "CREATE EXTENSION IF NOT EXISTS plpgsql" ▒▒▒▒▒▒▒▒▒▒▒▒▒▒ psql: FATAL: role "-c" does not exist \033[1;33m - Setting up schema from ./sql/northwind.pg.sql \033[0m psql: FATAL: role "-q" does not exist \033[1;33m - Importing data from ./sql/northwind_data.sql (this may take a while)\033[0m psql: FATAL: role "-q" does not exist

I don't understand why psql regognizes "-c" and "-q" as roles and not as options.

YanZaytsev avatar Jul 11 '18 17:07 YanZaytsev

@WhiteNoise15 make sure you have a user and role in your database that match your machine login (in this case, looks like yanza)

mike-north avatar Jul 12 '18 17:07 mike-north

@mike-north Thanks. I created yanza user and role, but I'm still getting FATAL: role "-q" does not exist and FATAL: role "-c" does not exist erorrs

YanZaytsev avatar Jul 12 '18 17:07 YanZaytsev

I'm getting an error when setting up mysql

$ npm run db:setup:mysql

> [email protected] db:setup:mysql C:\usbWebserver\root\sql-fundamentals
> scripty

Executing "C:\usbWebserver\root\sql-fundamentals\scripts\db\setup\mysql.sh":

> #!/usr/bin/env sh
> echo "\033[0;32mSetting Up MySQL Database. This may take a few minutes...\033[                          0m"
> echo "\033[1;33m - Removing any existing northwind database (you may need to p                          rovide a password)\033[0m"
> mysqladmin -f drop northwind
> echo "\033[1;33m - Removing any existing northwind_user user\033[0m"
> mysql -f -e "drop user 'northwind_user'@'localhost'";
>
> echo "\033[1;33m - Creating northwind_user\033[0m"
> mysql -f -e "create user 'northwind_user'@'localhost' IDENTIFIED BY 'theWindi\                          $bl0wing';";
>
> echo "\033[1;33m - Creating northwind database\033[0m"
> mysqladmin -f create 'northwind';
>
> echo "\033[1;33m - Granting all northwind database permissions to northwind_us                          er\033[0m"
> mysql -uroot -f -e "GRANT ALL PRIVILEGES ON northwind.* TO 'northwind_user'@'l                          ocalhost';FLUSH PRIVILEGES;";
>
> echo "\033[1;33m - Setting up schema from ./sql/northwind.mysql.sql \033[0m"
> mysql -f -D northwind < ./sql/northwind.mysql.sql
> echo "\033[1;33m - Importing data from ./sql/northwind_data.sql (this may take a while)\033[0m"
> mysql -f -D northwind < ./sql/northwind_data.sql
>
>


internal/child_process.js:330
    throw errnoException(err, 'spawn');
    ^

Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:330:11)
    at exports.spawn (child_process.js:500:9)
    at module.exports (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\lib\run\spawn-script.js:8:15)
    at C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\lib\run\commandify.js:6:7
    at C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:718:13
    at iterate (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:262:13)
    at async.forEachOfSeries.async.eachOfSeries (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:281:9)
    at _parallel (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:717:9)
    at async.series (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:739:9)
    at module.exports (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\lib\run\all.js:5:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] db:setup:mysql: `scripty`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] db:setup:mysql 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\eddyv\AppData\Roaming\npm-cache\_logs\2018-08-06T06_45_04_065Z-debug.log

I have installed MySQL (full install) from https://dev.mysql.com/downloads/file/?id=479862 I am running node 8.9.3 and npm 5.5.1 and I have also tried node 10.8.0 with npm 6.2.0 (latest) and it does not seem to work.

Also, when running npm install I get the following:

npm install.....
PS C:\usbWebserver\root\sql-fundamentals> npm install

> [email protected] install C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.0/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  unpack_sqlite_dep
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\Release\\sqlite3.lib
  database.cc
  node_sqlite3.cc
  statement.cc
  win_delay_load_hook.cc
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(839): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\st
atement.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(177): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\statement.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(854): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\st
atement.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(170): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\statement.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(869): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\st
atement.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(163): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\statement.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(1648): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\s
tatement.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(177): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\statement.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(839): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\no
de_sqlite3.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(177): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\node_sqlite3.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(854): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\no
de_sqlite3.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(170): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\node_sqlite3.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(869): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\no
de_sqlite3.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(163): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\node_sqlite3.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(839): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\da
tabase.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(177): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\database.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(854): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\da
tabase.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(170): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\database.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(869): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\da
tabase.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(163): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\database.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(1648): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\n
ode_sqlite3.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(177): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\node_sqlite3.cc)
C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan.h(1648): warning C4996: 'node::MakeCallback': was declared deprecated (compiling source file ..\src\d
atabase.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\Users\eddyv\.node-gyp\10.8.0\include\node\node.h(177): note: see declaration of 'node::MakeCallback' (compiling source file ..\src\database.cc)
..\src\statement.cc(103): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3
.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\statement.cc(277): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of data [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modul
es\sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(21): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(22): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(23): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(24): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(26): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(28): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(30): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(31): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(32): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(33): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(34): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(35): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(36): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(37): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(38): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(39): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(40): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(41): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\database.cc(133): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.
vcxproj]
..\src\node_sqlite3.cc(42): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'c:\usbwebserver\root\sql-fundamentals\
  node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'

..\src\node_sqlite3.cc(43): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
..\src\database.cc(134): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.
vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(44): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(45): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(46): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(47): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(48): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(49): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(50): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(51): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(52): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(53): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(54): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(55): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
..\src\node_sqlite3.cc(56): warning C4996: 'Nan::ForceSet': was declared deprecated [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlit
e3.vcxproj]
  c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_maybe_43_inl.h(130): note: see declaration of 'Nan::ForceSet'
c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_new.h(208): warning C4244: 'argument': conversion from 'sqlite3_int64' to 'double', possible loss of
data (compiling source file ..\src\statement.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  ..\src\statement.cc(479): note: see reference to function template instantiation 'v8::Local<v8::Number> Nan::New<v8::Number,sqlite3_int64>(A0)' being compiled
          with
          [
              A0=sqlite3_int64
          ]
c:\usbwebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\nan\nan_new.h(208): warning C4244: 'argument': conversion from 'sqlite3_int64' to 'double', possible loss of
data (compiling source file ..\src\database.cc) [C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  ..\src\database.cc(502): note: see reference to function template instantiation 'v8::Local<v8::Number> Nan::New<v8::Number,sqlite3_int64>(A0)' being compiled
          with
          [
              A0=sqlite3_int64
          ]
     Creating library C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\Release\node_sqlite3.lib and object C:\usbWebserver\root\sql-fundamentals
  \node_modules\sqlite\node_modules\sqlite3\build\Release\node_sqlite3.exp
  Generating code
  All 3993 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  node_sqlite3.vcxproj -> C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\Release\\node_sqlite3.node
  Copying C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite\node_modules\sqlite3\build\Release\/node_sqlite3.node to C:/usbWebserver/root/sql-fundamentals/node_modules/sqli
  te/node_modules/sqlite3/lib/binding/node-v64-win32-x64\node_sqlite3.node
          1 file(s) copied.

> [email protected] install C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "C:\usbWebserver\root\sql-fundamentals\node_modules\sqlite3\lib\binding\node-v64-win32-x64\node_sqlite3.node" is installed via remote

> [email protected] postinstall C:\usbWebserver\root\sql-fundamentals\node_modules\nodemon
> node -e "console.log('\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n')" || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

added 680 packages from 977 contributors and audited 2288 packages in 88.085s
found 14 vulnerabilities (8 low, 6 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

[edit] I installed MySQL 5.7 again and the mysqlshow command isn't even working in MySQL Shell:

MySQL  JS > mysqlshow -uroot -p
ReferenceError: mysqlshow is not defined

[edit 2] Well I just installed Ubuntu 18.04 to dual-boot on my Windows laptop. Going to give that a go soon.

[edit 3] It worked! Although populating the database (MySQL) took over 8 hours!

Pro tip for Windows users
Just use Linux It actually was really easy to setup with Ubuntu 18.04. Make sure you install Nvidia drivers if you have a dedicated GPU

EddyVinck avatar Aug 06 '18 06:08 EddyVinck

I went through the running the scripts manually, I didn't test with MySQL and PostgreSQL. Working fine with SQLite . But another different error related to expressWinston library throwing the error, I don't know the impact but of that library but I have commented its usage in express-server.ts It was working fine then hoping it would fine for others and in other instances.

Try running the scripts manually it would work I suppose. I tried testing small scripts, but they were also throwing an error as shown above '' spawn unknown ". I think this error is related to library scripty.

nikhilkuyya avatar Oct 05 '18 12:10 nikhilkuyya

I am finding the same error as @EddyVinck when running npm run db:setup:pg. PostgreSQL seems to be installed okay.

npm code output

PS C:\users\mikem\desktop\sql> npm run db:setup:pg

@mikeworks/[email protected] db:setup:pg C:\users\mikem\desktop\sql scripty

Executing "C:\users\mikem\desktop\sql\scripts\db\setup\pg.sh":

#!/usr/bin/env sh echo "\033[0;32mSetting Up PostgreSQL Database. This may take a few minutes...\033[0m" echo "\033[1;33m - Removing any existing northwind database (if this hangs: "killall -9 psql")\033[0m" dropdb northwind echo "\033[1;33m - Removing any existing northwind_user user\033[0m" dropuser northwind_user

echo "\033[1;33m - Creating northwind database\033[0m" createdb northwind

echo "\033[1;33m - Ensuring plpgsql extension is installed\033[0m" psql northwind -c "CREATE EXTENSION IF NOT EXISTS plpgsql"

echo "\033[1;33m - Setting up schema from ./sql/northwind.pg.sql \033[0m" psql northwind < ./sql/northwind.pg.sql -q echo "\033[1;33m - Importing data from ./sql/northwind_data.sql (this may take a while)\033[0m" psql northwind < ./sql/northwind_data.sql -q

echo "\033[1;33m - Creating user: northwind_user\033[0m" psql template1 -c "create user northwind_user;" psql template1 -c "alter user northwind_user password 'theWindi$bl0wing';" echo "\033[1;33m - Assigning ownership of northwind database to northwind_user\033[0m" psql template1 -c "grant all on DATABASE northwind to northwind_user;" psql northwind -c "GRANT ALL on ALL tables IN SCHEMA public to northwind_user" psql northwind -c "alter table "customerorder" owner to northwind_user" psql northwind -c "alter table "orderdetail" owner to northwind_user" psql northwind -c "alter table "product" owner to northwind_user" psql northwind -c "alter table "employee" owner to northwind_user" psql northwind -c "alter table "customer" owner to northwind_user" psql northwind -c "alter table "supplier" owner to northwind_user"

internal/child_process.js:358 throw errnoException(err, 'spawn'); ^

Error: spawn UNKNOWN at ChildProcess.spawn (internal/child_process.js:358:11) at spawn (child_process.js:533:9) at module.exports (C:\Users\mikem\Desktop\sql\node_modules\scripty\lib\run\spawn-script.js:8:15) at C:\Users\mikem\Desktop\sql\node_modules\scripty\lib\run\commandify.js:6:7 at C:\Users\mikem\Desktop\sql\node_modules\async\dist\async.js:3880:24 at replenish (C:\Users\mikem\Desktop\sql\node_modules\async\dist\async.js:1011:17) at C:\Users\mikem\Desktop\sql\node_modules\async\dist\async.js:1016:9 at eachOfLimit (C:\Users\mikem\Desktop\sql\node_modules\async\dist\async.js:1041:24) at C:\Users\mikem\Desktop\sql\node_modules\async\dist\async.js:1046:16 at _parallel (C:\Users\mikem\Desktop\sql\node_modules\async\dist\async.js:3879:5) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @mikeworks/[email protected] db:setup:pg: scripty npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @mikeworks/[email protected] db:setup:pg 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\mikem\AppData\Roaming\npm-cache_logs\2018-11-14T00_16_30_870Z-debug.log

I navigated to the scripts folder and executed the shell script. For some reason it executes in git bash, and keeps asking for password for user -c:

The entire script seems to hang at each step, unless I do ctrl-c. Then it proceeds...

npm code output \033[0;32mSetting Up PostgreSQL Database. This may take a few minutes...\033[0m \033[1;33m - Removing any existing northwind database (if this hangs: "killall -9 psql")\033[0m

c \033[1;33m - Removing any existing northwind_user user\033[0m

\033[1;33m - Creating northwind database\033[0m

\033[1;33m - Ensuring plpgsql extension is installed\033[0m psql: warning: extra command-line argument "CREATE EXTENSION IF NOT EXISTS plpgs ql" ignored Password for user -c: \033[1;33m - Setting up schema from ./sql/northwind.pg.sql \033[0m bash: ./sql/northwind.pg.sql: No such file or directory \033[1;33m - Importing data from ./sql/northwind_data.sql (this may take a while)\033[0m bash: ./sql/northwind_data.sql: No such file or directory \033[1;33m - Creating user: northwind_user\033[0m psql: warning: extra command-line argument "create user northwind_user;" ignored

psql: warning: extra command-line argument "alter user northwind_user password ' theWindi$bl0wing';" ignored Password for user -c: \033[1;33m - Assigning ownership of northwind database to northwind_user\033[0m psql: warning: extra command-line argument "grant all on DATABASE northwind to n orthwind_user;" ignored psql: warning: extra command-line argument "GRANT ALL on ALL tables IN SCHEMA pu blic to northwind_user" ignored psql: warning: extra command-line argument "alter table "customerorder" owner to northwind_user" ignored psql: warning: extra command-line argument "alter table "orderdetail" owner to n orthwind_user" ignored psql: warning: extra command-line argument "alter table "product" owner to north wind_user" ignored Password for user -c: psql: fe_sendauth: no password supplied psql: warning: extra command-line argument "alter table "employee" owner to nort hwind_user" ignored psql: warning: extra command-line argument "alter table "customer" owner to nort hwind_user" ignored psql: warning: extra command-line argument "alter table "supplier" owner to nort hwind_user" ignored Password for user -c:

\033[1;33m - Creating northwind database\033[0m

\033[1;33m - Ensuring plpgsql extension is installed\033[0m psql: warning: extra command-line argument "CREATE EXTENSION IF NOT EXISTS plpgs ql" ignored Password for user -c: \033[1;33m - Setting up schema from ./sql/northwind.pg.sql \033[0m bash: ./sql/northwind.pg.sql: No such file or directory \033[1;33m - Importing data from ./sql/northwind_data.sql (this may take a while)\033[0m bash: ./sql/northwind_data.sql: No such file or directory \033[1;33m - Creating user: northwind_user\033[0m psql: warning: extra command-line argument "create user northwind_user;" ignored

psql: warning: extra command-line argument "alter user northwind_user password ' theWindi$bl0wing';" ignored Password for user -c: \033[1;33m - Assigning ownership of northwind database to northwind_user\033[0m psql: warning: extra command-line argument "grant all on DATABASE northwind to n orthwind_user;" ignored psql: warning: extra command-line argument "GRANT ALL on ALL tables IN SCHEMA pu blic to northwind_user" ignored psql: warning: extra command-line argument "alter table "customerorder" owner to northwind_user" ignored Password for user -c:

Mikhail-MM avatar Nov 14 '18 00:11 Mikhail-MM

I managed to install the northwind DB manually by creating the new database name in pg4admin, navigating to the database in the left panel, and going to the "Create Script" (Right-most button in the top nav-bar with a lightning bolt icon). I pasted the following script: https://github.com/pthom/northwind_psql/blob/master/northwind.sql , and clicked "Execute/Refresh(F5)" in the secondary nav bar. This seems to have populated the database with the necessary options

Edit: I think this is a different script than intended, so you can do the same by pasting the contents of northwind.pg.sql and northwind_data.sql into pg4admin

Edit2: While I was able to load up the database, something seems to be wrong with running the scripts on Windows 10. I tried to run them using WSL + Ubuntu in bash, but still had some trouble. There are some great exercises here so I will try on a fresh install some other time

Mikhail-MM avatar Nov 14 '18 01:11 Mikhail-MM

I'm getting an error when setting up mysql

$ npm run db:setup:mysql

> [email protected] db:setup:mysql C:\usbWebserver\root\sql-fundamentals
> scripty

Executing "C:\usbWebserver\root\sql-fundamentals\scripts\db\setup\mysql.sh":

> #!/usr/bin/env sh
> echo "\033[0;32mSetting Up MySQL Database. This may take a few minutes...\033[                          0m"
> echo "\033[1;33m - Removing any existing northwind database (you may need to p                          rovide a password)\033[0m"
> mysqladmin -f drop northwind
> echo "\033[1;33m - Removing any existing northwind_user user\033[0m"
> mysql -f -e "drop user 'northwind_user'@'localhost'";
>
> echo "\033[1;33m - Creating northwind_user\033[0m"
> mysql -f -e "create user 'northwind_user'@'localhost' IDENTIFIED BY 'theWindi\                          $bl0wing';";
>
> echo "\033[1;33m - Creating northwind database\033[0m"
> mysqladmin -f create 'northwind';
>
> echo "\033[1;33m - Granting all northwind database permissions to northwind_us                          er\033[0m"
> mysql -uroot -f -e "GRANT ALL PRIVILEGES ON northwind.* TO 'northwind_user'@'l                          ocalhost';FLUSH PRIVILEGES;";
>
> echo "\033[1;33m - Setting up schema from ./sql/northwind.mysql.sql \033[0m"
> mysql -f -D northwind < ./sql/northwind.mysql.sql
> echo "\033[1;33m - Importing data from ./sql/northwind_data.sql (this may take a while)\033[0m"
> mysql -f -D northwind < ./sql/northwind_data.sql
>
>


internal/child_process.js:330
    throw errnoException(err, 'spawn');
    ^

Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:330:11)
    at exports.spawn (child_process.js:500:9)
    at module.exports (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\lib\run\spawn-script.js:8:15)
    at C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\lib\run\commandify.js:6:7
    at C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:718:13
    at iterate (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:262:13)
    at async.forEachOfSeries.async.eachOfSeries (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:281:9)
    at _parallel (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:717:9)
    at async.series (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\node_modules\async\lib\async.js:739:9)
    at module.exports (C:\usbWebserver\root\sql-fundamentals\node_modules\scripty\lib\run\all.js:5:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] db:setup:mysql: `scripty`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] db:setup:mysql 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\eddyv\AppData\Roaming\npm-cache\_logs\2018-08-06T06_45_04_065Z-debug.log

I have installed MySQL (full install) from https://dev.mysql.com/downloads/file/?id=479862 I am running node 8.9.3 and npm 5.5.1 and I have also tried node 10.8.0 with npm 6.2.0 (latest) and it does not seem to work.

Also, when running npm install I get the following:

npm install..... [edit] I installed MySQL 5.7 again and the mysqlshow command isn't even working in MySQL Shell:

MySQL  JS > mysqlshow -uroot -p
ReferenceError: mysqlshow is not defined

[edit 2] Well I just installed Ubuntu 18.04 to dual-boot on my Windows laptop. Going to give that a go soon.

[edit 3] It worked! Although populating the database (MySQL) took over 8 hours!

Pro tip for Windows users

I was able to make the project run on Windows to support MySQL by following the steps given by the Scripty module in its Wiki to support Windows.

In short, I created a folder called scripts-win, changed the .sh extension to .cmd and finally changed all the calls to UNIX-like commands for similar behavior commands in Windows. Later, I will create a Pull Request supporting the other Databases.

GianCastle avatar Dec 28 '18 01:12 GianCastle