dodona-edu / dolos

:detective: Source code plagiarism detection
https://dolos.ugent.be
MIT License
263 stars 32 forks source link

Installation of @dodona/dolos Fails on Windows #1574

Open FaizaTafannum opened 4 months ago

FaizaTafannum commented 4 months ago

**Dolos CLI

I am encountering an issue when trying to install the @dodona/dolos package on a Windows machine. I have tried using this npm install -g @dodona/dolos on the cmd as admin, on Microsoft Visual Studio 2022 but I get the errors below. My node version is v18.10.0 and npm version is 8.19.2. I have tried using --unsafe-perm flag, clearing the npm cache, removing the package-lock json file, deleting the node-module file and reinstalling. Nothing worked. I have attached the complete log of the run. 2024-07-08T20_13_30_949Z-debug-0.log **

npm ERR! code 1 npm ERR! path C:\Users\far04\npm-global\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.1.0 npm ERR! gyp info using node@18.10.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.11.0 found at "C:\Users\far04\AppData\Local\Programs\Python\Python311\python.exe" npm ERR! gyp info find VS using VS2022 (17.10.35013.160) found at: npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" npm ERR! gyp info find VS run with --verbose for detailed information npm ERR! gyp info spawn C:\Users\far04\AppData\Local\Programs\Python\Python311\python.exe npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args 'C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'msvs', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\far04\npm-global\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers\build\config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\far04\AppData\Local\node-gyp\Cache\18.10.0\include\node\common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=C:\Users\far04\AppData\Local\node-gyp\Cache\18.10.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\far04\\AppData\\Local\\node-gyp\\Cache\\18.10.0\\<(target_arch)\\node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\Users\far04\npm-global\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'C:\Users\far04\npm-global\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers\build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! Traceback (most recent call last): npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 45, in npm ERR! sys.exit(gyp.script_main()) npm ERR! ^^^^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp__init.py", line 662, in script_main npm ERR! return main(sys.argv[1:]) npm ERR! ^^^^^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp__init__.py", line 654, in main npm ERR! return gyp_main(args) npm ERR! ^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\init.py", line 639, in gyp_main npm ERR! generator.GenerateOutput(flat_list, targets, data, params) npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2162, in GenerateOutput npm ERR! sln = MSVSNew.MSVSSolution( npm ERR! ^^^^^^^^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 228, in init npm ERR! self.Write() npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 255, in Write npm ERR! f = writer(self.path) npm ERR! ^^^^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 422, in WriteOnDiff npm ERR! return Writer() npm ERR! ^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 360, in init__ npm ERR! tmp_fd, self.tmp_path = tempfile.mkstemp( npm ERR! ^^^^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 341, in mkstemp npm ERR! return _mkstemp_inner(dir, prefix, suffix, flags, output_type) npm ERR! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ npm ERR! File "C:\Users\far04\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 256, in _mkstemp_inner npm ERR! fd = _os.open(file, flags, 0o600) npm ERR! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ npm ERR! FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\far04\npm-global\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers\build\bash\binding.sln.gyp.mjzirl0f.tmp' npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:284:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Windows_NT 10.0.22631 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\far04\AppData\Roaming\nvm\v18.10.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\Users\far04\npm-global\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers npm ERR! gyp ERR! node -v v18.10.0 npm ERR! gyp ERR! node-gyp -v v9.1.0 npm ERR! gyp ERR! not ok

rien commented 4 months ago

Hi @FaizaTafannum, there is indeed an issue with installing Dolos on Windows (see https://github.com/dodona-edu/dolos/issues/1559).

If possible, you could use Windows Subsystem for Linux (WSL2) and install Dolos CLI there, that should help. Alternatively, you could also use our Dolos webserver (https://dolos.ugent.be/server).

I've opened an issue with node-gyp (https://github.com/nodejs/node-gyp/issues/3040) as wasn't able to find out the cause yet.

FaizaTafannum commented 4 months ago

Thank you. I am using Ubuntu 22.04 LTS on Virtual Machine. And I have the errors below while trying to insall dolos using sudo npm install @dodona/dolos on VS Code I have attached the complete log of the run again in a txt file, error log ubuntu.txt

(.venv) faiza@faiza-VirtualBox:~/Documents/CodeIPPrompt/CodeIPPrompt-master$ sudo npm install @dodona/dolos npm error code 1 npm error path /home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/@dodona/dolos-parsers npm error command failed npm error command sh -c node-gyp rebuild npm error gyp info it worked if it ends with ok npm error gyp info using node-gyp@10.1.0 npm error gyp info using node@22.4.1 | linux | x64 npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3" npm error gyp http GET https://nodejs.org/download/release/v22.4.1/node-v22.4.1-headers.tar.gz npm error gyp http 200 https://nodejs.org/download/release/v22.4.1/node-v22.4.1-headers.tar.gz npm error gyp http GET https://nodejs.org/download/release/v22.4.1/SHASUMS256.txt npm error gyp http 200 https://nodejs.org/download/release/v22.4.1/SHASUMS256.txt npm error gyp info spawn /usr/bin/python3 npm error gyp info spawn args [ npm error gyp info spawn args '/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp/gyp/gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'make', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/@dodona/dolos-parsers/build/config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp/addon.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args '/root/.cache/node-gyp/22.4.1/include/node/common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/22.4.1', npm error gyp info spawn args '-Dnode_gyp_dir=/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp', npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/22.4.1/<(target_arch)/node.lib', npm error gyp info spawn args '-Dmodule_root_dir=/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/@dodona/dolos-parsers', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'build', npm error gyp info spawn args '-Goutput_dir=.' npm error gyp info spawn args ] npm error gyp ERR! build error npm error gyp ERR! stack Error: not found: make npm error gyp ERR! stack at getNotFoundError (/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/which/lib/index.js:16:17) npm error gyp ERR! stack at which (/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/which/lib/index.js:77:9) npm error gyp ERR! stack at async doWhich (/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp/lib/build.js:112:22) npm error gyp ERR! stack at async loadConfigGypi (/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp/lib/build.js:77:7) npm error gyp ERR! stack at async build (/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp/lib/build.js:35:3) npm error gyp ERR! stack at async run (/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/node-gyp/bin/node-gyp.js:81:18) npm error gyp ERR! System Linux 6.8.0-36-generic npm error gyp ERR! command "/usr/bin/node" "/home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/.bin/node-gyp" "rebuild" npm error gyp ERR! cwd /home/faiza/Documents/CodeIPPrompt/CodeIPPrompt-master/node_modules/@dodona/dolos-parsers npm error gyp ERR! node -v v22.4.1 npm error gyp ERR! node-gyp -v v10.1.0 npm error gyp ERR! not ok

rien commented 4 months ago

It seems like make is not present on your system, and probably some other build tools are missing as well. These are required to build the native extensions.

You can install those tools by installing the build-essential package:

sudo apt install build-essential