Whenever I try to install an NPM module or run scripts I get several error messages
When I enter npm run dev I get this message:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/hc/northcoders/projects/exhibition-curation-platform/package.json
npm ERR! errno -2
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/hc/northcoders/projects/exhibition-curation-platform/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: /home/hc/.npm/_logs/2024-12-20T15_26_19_111Z-debug-0.log
here’s the log file:
0 verbose cli /home/hc/.nvm/versions/node/v21.6.2/bin/node /home/hc/.nvm/versions/node/v21.6.2/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/home/hc/.nvm/versions/node/v21.6.2/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/hc/northcoders/projects/exhibition-curation-platform/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/hc/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/home/hc/.nvm/versions/node/v21.6.2/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 5ms
17 timing npm:load:configload Completed in 5ms
18 timing config:load:flatten Completed in 1ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 1ms
21 verbose title npm run dev
22 verbose argv "run" "dev"
23 timing npm:load:setTitle Completed in 1ms
24 timing npm:load:display Completed in 0ms
25 verbose logfile logs-max:10 dir:/home/hc/.npm/_logs/2024-12-20T15_26_19_111Z-
26 verbose logfile /home/hc/.npm/_logs/2024-12-20T15_26_19_111Z-debug-0.log
27 timing npm:load:logFile Completed in 17ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 35ms
31 timing command:run Completed in 1ms
32 verbose stack Error: Could not read package.json: Error: ENOENT: no such file or directory, open '/home/hc/northcoders/projects/exhibition-curation-platform/package.json'
32 verbose stack at async open (node:internal/fs/promises:633:25)
32 verbose stack at async readFile (node:internal/fs/promises:1242:14)
32 verbose stack at async PackageJson.load (/home/hc/.nvm/versions/node/v21.6.2/lib/node_modules/npm/node_modules/@npmcli/package-json/lib/index.js:129:31)
32 verbose stack at async PackageJson.normalize (/home/hc/.nvm/versions/node/v21.6.2/lib/node_modules/npm/node_modules/@npmcli/package-json/lib/index.js:115:5)
32 verbose stack at async RunScript.run (/home/hc/.nvm/versions/node/v21.6.2/lib/node_modules/npm/lib/commands/run-script.js:72:27)
32 verbose stack at async module.exports (/home/hc/.nvm/versions/node/v21.6.2/lib/node_modules/npm/lib/cli-entry.js:61:5)
33 verbose cwd /home/hc/northcoders/projects/exhibition-curation-platform
34 verbose Linux 6.8.0-49-generic
35 verbose node v21.6.2
36 verbose npm v10.2.4
37 error code ENOENT
38 error syscall open
39 error path /home/hc/northcoders/projects/exhibition-curation-platform/package.json
40 error errno -2
41 error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/hc/northcoders/projects/exhibition-curation-platform/package.json'
42 error enoent This is related to npm not being able to find a file.
42 error enoent
43 verbose exit -2
44 timing npm Completed in 76ms
45 verbose code -2
46 error A complete log of this run can be found in: /home/hc/.npm/_logs/2024-12-20T15_26_19_111Z-debug-0.log
Fairly sure this only started happening after following some instructions online to fix a bluetooth problem on my laptop – had no idea what I was doing
running Node 10.2.4 on Ubuntu 22.04
Any help would be much appreciated,
Thanks