I want to install an environment on my ubuntu laptop to test a graphql endpoint
- User
I want to install an environment on my ubuntu laptop to test a graphql endpoint
- Assistant
To test a GraphQL endpoint, you can set up a development environment on your Ubuntu laptop by following these steps:
- User
I already have an endpoint, so i want to access it and also have a local gui playground to test it
- Assistant
If you already have a GraphQL endpoint and want to access it from your Ubuntu laptop, you can use a GraphQL GUI playground like GraphQL Playground or GraphQL IDE. To set it up, follow these steps:
- User
I get this error:
const express = require(‘express’);
SyntaxError: Invalid or unexpected token at internalCompileFunction (node:internal/vm:74:18) at wrapSafe (node:internal/modules/cjs/loader:1141:20) at Module._compile (node:internal/modules/cjs/loader:1182:27) at Module._extensions..js (node:internal/modules/cjs/loader:1272:10) at Module.load (node:internal/modules/cjs/loader:1081:32) at Module._load (node:internal/modules/cjs/loader:922:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47
Node.js v18.13.0
- Assistant
The error message suggests that there is an issue with the syntax in your code. It appears that you are using incorrect quotation marks (
‘’) around the'express'module import, which is causing the SyntaxError.To resolve this, replace the incorrect quotation marks with regular single quotes (
'') or double quotes ("") around'express'in your code. The corrected import statement should look like this:javascriptconst express = require('express');After making this change, your code should run without any syntax errors.
- User
console.log(Server running at http://localhost:${port}); ^^^^^^
SyntaxError: missing ) after argument list
- Assistant
The error message indicates that you are missing a closing parenthesis in your
console.logstatement.To resolve this issue, modify the
console.logline to include the missing closing parenthesis. Here's the corrected line of code:javascriptconsole.log(`Server running at http://localhost:${port}`);After making this change, the error should be resolved, and your code should execute without any missing parenthesis errors.