Back End: Postman app

Hi,
I am currently stuck at the beginning of this postman app.
The instructions are:
Follow these steps to get the example backend set up:

  1. Download the example backend directory here.
  2. Unzip the file.
  3. Navigate into the directory through your command line (use cd example_backend from whichever directory you unzipped it into).
  4. Make sure you have Node installed. To check, you can run npm -v on your command line. If you see a version number, you have Node. If the npm command is not found, you should follow these steps to install Node.
  5. Run npm install from inside the example_backend directory to install all of the project’s dependencies.
  6. To start the server, run node server.js from inside the example_backend directory. Now, this simple server should be running at http://localhost:4000.

I completed steps 1-5 and on step 6 after entering node server.js, I get the follwing error message:
PS D:\project coding april 2023\BackEnd\example_backend> node server.js
node:internal/modules/cjs/loader:1078
throw err;
^

Error: Cannot find module ‘express’
Require stack:

  • D:\project coding april 2023\BackEnd\example_backend\server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘D:\project coding april 2023\BackEnd\example_backend\server.js’
    ]
    }

I have unzipped the downloaded file again and repeated the same steps, but it results in the same error.
I would appreciate for a solution.

Regards,

2 Likes

Hmm, are you sure you ran npm install in the example_backend directory? The module should be there if this command ran successfully.

What happens if you install express manually? As in, what happens when you run npm install express in the exmple_directory and then run node server.js

Keep in mind you also have to run node server.js within the example_directory.

Hi,
Thanks for your respond. After following your advice, the following messages appeared:

PS D:\project coding april 2023\BackEnd\example_backend> npm -v
9.5.1
PS D:\project coding april 2023\BackEnd\example_backend> npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient…
npm WARN old lockfile
npm WARN deprecated [email protected]: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · debug-js/debug · GitHub)
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup ‘D:\project coding april 2023\BackEnd\example_backend\node_modules’,
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir ‘D:\project coding april 2023\BackEnd\example_backend\node_modules\needle\node_modules\debug’] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: ‘EPERM’,
npm WARN cleanup syscall: ‘rmdir’,
npm WARN cleanup path: ‘D:\project coding april 2023\BackEnd\example_backend\node_modules\needle\node_modules\debug’
npm WARN cleanup }
npm WARN cleanup ],
npm WARN cleanup [
npm WARN cleanup ‘D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp’,
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir ‘D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp\lib’] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: ‘EPERM’,
npm WARN cleanup syscall: ‘rmdir’,
npm WARN cleanup path: ‘D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp\lib’
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108’ (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for “D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node” (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v108 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.11 found at “C:\Users\nikol\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe”
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with ‘–loglevel silly’ for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the “Desktop development with C++” workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js native addon build tool
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:369:14)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:390:16
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “configure” “–fallback-to-build” “–module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node” “–module_name=node_sqlite3” “–module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64” “–napi_version=8” “–node_abi_napi=napi” “–napi_build_version=0” “–node_napi_label=node-v108”
npm ERR! gyp ERR! cwd D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108’ (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess. (D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.22000
npm ERR! node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build”
npm ERR! node-pre-gyp ERR! cwd D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3
npm ERR! node-pre-gyp ERR! node -v v18.16.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nikol\AppData\Local\npm-cache_logs\2023-06-07T01_30_17_713Z-debug-0.log
PS D:\project coding april 2023\BackEnd\example_backend> ls

Directory: D:\project coding april 2023\BackEnd\example_backend

Mode LastWriteTime Length Name


d---- 07/06/2023 08:30 node_modules
-a— 01/03/2020 11:05 795 db.js
-a— 01/03/2020 10:02 43876 package-lock.json
-a— 01/03/2020 10:52 375 package.json
-a— 01/03/2020 11:05 1361 server.js

The node modules are empty. Running the npm install express causes similar error (WARN old lockfile).
I am new in coding and do not know what kind of steps should i take from this error.

Hey @biruskai ,

Thanks for sharing the message. Ironically the solution is in the problem itself! Basically it looks like you don’t have sqlite3 installed on your machine, which is causing npm install to fail. Are you sure you have sqlite3 installed on your machine?

The reason why I believe this is because your error message prints the following:

npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108’ (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for “D:\project coding april

If you look at the npm docs for sqlite3 you’ll see that it uses node-pre-gyp . I verified this by running npm install on my windows machine that doesn’t have sqlite3 installed, and then running the same commands on my linux partition that does have sqlite 3 installed. I got the same error as you when running the command in my windows machine.

If you don’t have sqlite3 installed, I would google “How to install sqlite3 on < the type of computer you have >” and then go from there. You’ll know you have sqlite3 installed locally when you run sqlite3 in the terminal and then it returns with what version you are using.

After you have sqlite 3 installed, I would create a new project, and then run the following commands:

  1. npm init -y (this will create a new package.json file)
  2. npm install express
  3. npm install sqlite3
  4. npm install body-parser
  5. Copy over db.js and server.js
  6. Run node server.js within the same directory as the files.

This will then spin up a server on port 4000. You should maybe add a simple GET route at "/" to return “Hello World.” This way you can confirm through the browser that your server is up.

If this is too much for you to do locally, maybe look at Replit which can help you install/connect to a sqlite3 instance in the cloud.

I have installed the sqlite3 successfully after your instruction.

PS D:\project coding april 2023\BackEnd\example_backend> sqlite3
SQLite version 3.42.0 2023-05-16 12:36:15
Enter “.help” for usage hints.
Connected to a transient in-memory database.
Use “.open FILENAME” to reopen on a persistent database.
sqlite>

However, start from step 2 (installing express), it produces the same error as previously.
Do you think, that postman app is similar to Thunder Client in Extension so that I can use it as an alternative ?

Hmm, i’m not familiar with Thunder Client, but they look similar, but your problem is not really related to this. I would need to see the exact exercise you’re doing, but I imagine the goal is to spin up a simple server on your machine, and then start testing it through the Postman app. So using a different app might not help. On top, installing express and npm packages is important in software development and chances are you’ll encounter this problem again if you don’t resolve it soon.

Do you mind sending me what your terminal prints when you run npm install express in your project directory?

Thanks!

PS D:\project coding april 2023\BackEnd\example_backend> sqlite3
SQLite version 3.42.0 2023-05-16 12:36:15
Enter “.help” for usage hints.
Connected to a transient in-memory database.
Use “.open FILENAME” to reopen on a persistent database.
sqlite> Program interrupted.
PS D:\project coding april 2023\BackEnd\example_backend> npm i express
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient…
npm WARN old lockfile
npm WARN deprecated [email protected]: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · debug-js/debug · GitHub)
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm ERR! code 1
npm ERR! path D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108’ (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for “D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node” (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v108 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v108-win32-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.11 found at “C:\Users\nikol\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe”
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with ‘–loglevel silly’ for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the “Desktop development with C++” workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js native addon build tool
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:369:14)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:390:16
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “configure” “–fallback-to-build” “–module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node” “–module_name=node_sqlite3” “–module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64” “–napi_version=8” “–node_abi_napi=napi” “–napi_build_version=0” “–node_napi_label=node-v108”
npm ERR! gyp ERR! cwd D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108’ (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess. (D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.22000
npm ERR! node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “D:\project coding april 2023\BackEnd\example_backend\node_modules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build”
npm ERR! node-pre-gyp ERR! cwd D:\project coding april 2023\BackEnd\example_backend\node_modules\sqlite3
npm ERR! node-pre-gyp ERR! node -v v18.16.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nikol\AppData\Local\npm-cache_logs\2023-06-08T01_54_09_142Z-debug-0.log
PS D:\project coding april 2023\BackEnd\example_backend>

Hey @biruskai ,

Wow that’s a lot! What’s interesting is that you’re still getting the sqlite3 error, but if you created a new project why are you getting warnings about an old lock file? Are you creating a new project in a completely different file as I mentioned here?

If possible, I would try and attend a chapter meeting to get on the spot assistance. If that’s not possible, I would maybe use the publicly available simple-books-api. There’s even a public postman collection on it

Creating new project in this case in my definition is deleting the old backend_example project, then redownloading the same file from codeacademy, unzipping the file , and open it new in vs code. That is what I did and I have retried it just now and the same error appears. Correct me if I am wrong.
However, I really appreciate your help and I might try the alternative solutions if it persists.

So what I’m suggesting is basically to re-create the codecademy file. In reality you only need the db.JS and the server.js file.

  1. Create a new folder.
  2. Create an empty db.js file in the folder.
  3. Create an empty server.js file in the folder.
  4. npm init -y
  5. npm install express
  6. npm install sqlite3
  7. Then copy over the contents of codecademy’ s db.js and server.js to your empty db.js and empty server.js.
  8. node server.js
7 Likes

It works. Thank you so much

1 Like

This saved me too. Thanks!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.