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

cant run tests..... #300

Open
gjames5355 opened this issue May 14, 2020 · 15 comments
Open

cant run tests..... #300

gjames5355 opened this issue May 14, 2020 · 15 comments

Comments

@gjames5355
Copy link

Git Branch: master
Test Filter: EX00
Applying Test Filter: EX00
/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/pg-packet-stream/src/inbound-parser.test.ts:1
import buffers from './testing/test-buffers'
^^^^^^^

SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/ts-node/src/index.ts:392:14)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at /Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/mocha.js:334:36
at Array.forEach ()
at Mocha.loadFiles (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/mocha.js:331:14)
at Mocha.run (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/mocha.js:809:10)
at Object.exports.singleRun (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/cli/run-helpers.js:108:16)
at exports.runMocha (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/cli/run-helpers.js:142:13)
at Object.exports.handler.argv [as handler] (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/cli/run.js:292:3)
at Object.runCommand (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/node_modules/yargs/lib/command.js:242:26)
at Object.parseArgs [as _parseArgs] (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/node_modules/yargs/yargs.js:1096:28)
at Object.parse (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/node_modules/yargs/yargs.js:575:25)
at Object.exports.main (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/lib/cli/cli.js:68:6)
at Object. (/Users/garrettjames/Desktop/thinkful-projects/sql/node_modules/mocha/bin/mocha:162:29)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @mikeworks/[email protected] test: scripty "EX00"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @mikeworks/[email protected] 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! /Users/garrettjames/.npm/_logs/2020-05-14T16_30_06_295Z-debug.log

@IamRKG
Copy link

IamRKG commented Jun 11, 2020

@mike-north I think version compatible issue.

@ianlavapiez
Copy link

Same issue here. Did anyone find a solution out of this?

@IamRKG
Copy link

IamRKG commented Jul 1, 2020

No.

@namiduru
Copy link

namiduru commented Jul 20, 2020

I have faced the same issue.
The problem could be happening from the DB version - DB driver match or node version.

@namiduru
Copy link

Guys try to install with npm install --no-optional if you have only SQLite in your system

If you don't have all DB systems mentioned in the course it throws that error.

Code is now working properly in my system with the following versions
SQLite 3.28.0
Node Version is: v12.14.1

@IamRKG
Copy link

IamRKG commented Jul 21, 2020

is this working without --no-optional?

@juanmarin97
Copy link

juanmarin97 commented Jul 23, 2020

Guys try to install with npm install --no-optional if you have only SQLite in your system

If you don't have all DB systems mentioned in the course it throws that error.

Code is now working properly in my system with the following versions
SQLite 3.28.0
Node Version is: v12.14.1

It works do rm -rf node_modules/ and later npm install --no-optional

@Wennlys
Copy link

Wennlys commented Aug 18, 2020

Guys try to install with npm install --no-optional if you have only SQLite in your system

If you don't have all DB systems mentioned in the course it throws that error.

Code is now working properly in my system with the following versions
SQLite 3.28.0
Node Version is: v12.14.1

I'm getting the same issue and it didn't work. :(
I already tried to change node's vesion, dababase version and so on...
Does anyone have any other shot?

@juanmarin97
Copy link

Guys try to install with npm install --no-optional if you have only SQLite in your system
If you don't have all DB systems mentioned in the course it throws that error.
Code is now working properly in my system with the following versions
SQLite 3.28.0
Node Version is: v12.14.1

I'm getting the same issue and it didn't work. :(
I already tried to change node's vesion, dababase version and so on...
Does anyone have any other shot?

In command line do

rm -rf node_modules/ 
npm install --no-optional

@mgpeters
Copy link

Anyway to make this work with psql?

@sunteago
Copy link

sunteago commented Sep 6, 2020

having same problem with mysql, npm install --no-optional seems to make tests work, but breaks the app

@ericArbour
Copy link

I was on node v14 and was getting esm build errors. I was able to get the app and the tests to run with the following:

SQLite 3.28.0
Node Version is: v12.14.1

If you previously did an npm install:

rm -rf node_modules/ 
npm install --no-optional

Note, I was only able to get this to work with sqlite.

@bananaspy
Copy link

is this working without --no-optional?

After setting up all databases try to checkout tag v1.0.21 using Node v9.11.2 - it worked for me without --no-optional

@halian-vilela
Copy link

is this working without --no-optional?

After setting up all databases try to checkout tag v1.0.21 using Node v9.11.2 - it worked for me without --no-optional

Node 9 seems so ancient...

I'm wondering if this app aged so badly that it wouldn't be compatible kind of 2 years later.

BTW, I've tried this combination and did no good, the error message just changed a little bit:

(function (exports, require, module, __filename, __dirname) { import buffers from './testing/test-buffers'
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (internal/modules/cjs/loader.js:618:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/ts-node/src/index.ts:392:14)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at /Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/mocha.js:334:36
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/mocha.js:331:14)
    at Mocha.run (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/mocha.js:809:10)
    at Object.exports.singleRun (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/cli/run-helpers.js:108:16)
    at exports.runMocha (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/cli/run-helpers.js:142:13)
    at Object.exports.handler.argv [as handler] (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/cli/run.js:292:3)
    at Object.runCommand (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/node_modules/yargs/lib/command.js:242:26)
    at Object.parseArgs [as _parseArgs] (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/node_modules/yargs/yargs.js:1096:28)
    at Object.parse (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/node_modules/yargs/yargs.js:575:25)
    at Object.exports.main (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/lib/cli/cli.js:68:6)
    at Object.<anonymous> (/Users/aurus/--Cursos/FrontEndMasters/sql/node_modules/mocha/bin/mocha:162:29)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @mikeworks/[email protected] test: `scripty "EX00"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @mikeworks/[email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My stack is:

$ git status
HEAD detached at v1.0.21
$ node -v
v9.11.2

Does anyone have another idea?

@christian-bravo7
Copy link

It works for me

$ git branch
On branch femasters/begin

$ node -v
v9.11.1

during the installation with npm I had the following error.

Error
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types/node/-/node-9.4.3.tgz
npm ERR! 404
npm ERR! 404  '@types/[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@types/fs-extra'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/christian/.npm/_logs/2020-12-28T21_23_26_121Z-debug.log

And it is because the @types/node version 9.4.3 is not found in the npm registry

Not found: https://registry.npmjs.org/@types/node/-/node-9.4.3.tgz

then I fix with the following...

Into package.lock.json change all references of @types/node with version 9.4.3 to 9.4.4. Including other dependencies that require that version (Make sure to add the correct integrity checksum for 9.4.4)

Example
{
     "@types/node": {
      "version": "9.4.4",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.4.tgz",
      "integrity": "sha512-pTi6f79uELOTQ2TtXxWcjmJ+iZa1C3ypm6pGNU/viOQX/VfBXLmsZEcJPk1rm+lia+GP6GpgFGUkCvLJ7JOKDA==",
      "dev": true
    },
    "other-dependency": {
      "version": "...",
      "resolved": "...",
      "integrity": "...",
      "dev": true,
      "requires": {
        "@types/node": "9.4.4",
      }
    }
}

Run

npm install --no-optional

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

No branches or pull requests