You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed all the packages and dependencies with sudo npm install -g nodemon. Then when I want to run the project with node script.js, this is what I get:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/username/Downloads/Face-Recognition-JavaScript-master/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/username/Downloads/Face-Recognition-JavaScript-master/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:
npm ERR! /Users/username/.npm/_logs/2020-08-24T06_01_03_368Z-debug.log
username@Users-MBP Face-Recognition-JavaScript-master % node script.js
/Users/username/Downloads/Face-Recognition-JavaScript-master/script.js:1
const imageUpload = document.getElementById('imageUpload')
^
ReferenceError: document is not defined
at Object.<anonymous> (/Users/username/Downloads/Face-Recognition-JavaScript-master/script.js:1:21)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
Activity
sayannath commentedon Aug 15, 2021
Have to install all the packages like this
npm i?amouratoglou commentedon Sep 13, 2023
really? there is not package.json
amouratoglou commentedon Sep 13, 2023
the way to run is to create a node server to serve the index.html file
a quick way:
npx servethen open
http://localhost:3000this could be included in the docs to help others try the example locally.
the index.html file won't resolve well the JS modules maps within an Apache server,