opengovsg / FormSG

Form builder for the Singapore Government
https://form.gov.sg
Other
275 stars 84 forks source link

Setting up local development fails #7760

Closed bunsy-0900 closed 1 month ago

bunsy-0900 commented 1 month ago

Issue

I followed the local development guide and got this error when running npm install && npm --prefix serverless/virus-scanner install.

npm warn deprecated @types/pino@7.0.5: This is a stub types definition. pino provides its own type definitions, so you do not need this installed.
npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm warn deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated superagent@7.1.6: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731)
npm error code 2
npm error path /mnt/.../FormSG/serverless/virus-scanner/node_modules/aws-lambda-ric
npm error command failed
npm error command sh -c ./scripts/preinstall.sh
npm error libtoolize: putting auxiliary files in '.'.
npm error libtoolize: copying file './ltmain.sh'
npm error libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
npm error libtoolize: copying file 'm4/libtool.m4'
npm error libtoolize: copying file 'm4/ltoptions.m4'
npm error libtoolize: copying file 'm4/ltsugar.m4'
npm error libtoolize: copying file 'm4/ltversion.m4'
npm error libtoolize: copying file 'm4/lt~obsolete.m4'
npm error libtoolize: Remember to add 'LT_INIT' to configure.ac.
npm error checking whether to enable maintainer-specific portions of Makefiles... no
npm error checking whether make supports nested variables... yes
npm error checking whether to enable debug build options... no
npm error checking whether to enable compiler optimizer... (assumed) yes
npm error checking whether to enable strict compiler warnings... no
npm error checking whether to enable compiler warnings as errors... no
npm error checking whether to enable curl debug memory tracking... no
npm error checking whether to enable hiding of library internal symbols... yes
npm error checking whether to enable c-ares for DNS lookups... no
npm error checking whether to disable dependency on -lrt... (assumed no)
npm error checking whether to enable ECH support... no
npm error checking for path separator... :
npm error checking for sed... /usr/bin/sed
npm error checking for grep... /usr/bin/grep
npm error checking for egrep... /usr/bin/grep -E
npm error checking for ar... /usr/bin/ar
npm error checking for a BSD-compatible install... /usr/bin/install -c
npm error checking for gcc... gcc
npm error checking whether the C compiler works... yes
npm error checking for C compiler default output file name... a.out
npm error checking for suffix of executables... 
npm error checking whether we are cross compiling... no
npm error checking for suffix of object files... o
npm error checking whether the compiler supports GNU C... yes
npm error checking whether gcc accepts -g... yes
npm error checking for gcc option to enable C11 features... none needed
npm error checking whether gcc understands -c and -o together... yes
npm error checking how to run the C preprocessor... gcc -E
npm error checking for a sed that does not truncate output... (cached) /usr/bin/sed
npm error checking for code coverage support... no
npm error checking whether sleep supports fractional seconds... yes
npm error checking filesystem timestamp resolution... 0.01
npm error checking whether build environment is sane... yes
npm error checking for a race-free mkdir -p... /usr/bin/mkdir -p
npm error checking for gawk... gawk
npm error checking whether make sets $(MAKE)... yes
npm error checking whether make supports the include directive... yes (GNU style)
npm error checking xargs -n works... yes
npm error checking dependency style of gcc... gcc3
npm error checking curl version... 7.83.1-DEV
npm error *** Do not use buildconf. Instead, just use: autoreconf -fi
npm error configure.ac:120: installing './compile'
npm error configure.ac:317: installing './config.guess'
npm error configure.ac:317: installing './config.sub'
npm error configure.ac:120: installing './install-sh'
npm error configure.ac:125: installing './missing'
npm error docs/examples/Makefile.am: installing './depcomp'
npm error parallel-tests: installing './test-driver'
npm error ./configure: line 6793: syntax error near unexpected token `;;'
npm error ./configure: line 6793: ` ;;'

Spec

node: v18.17.1 npm: 9.6.7

kevin9foong commented 1 month ago

Hi @bunsy-0900 , I am not able to reproduce the above error:

could you try without the virus-scanner first? (note: virus scanner only affects file uploads eg, Attachments, most of FormSG will still work without it)

Setup Steps:

  1. git clone a fresh copy of FormSG in a new directory
  2. from root directory, run npm i

After those 2 steps: To run the frontend, npm run dev:frontend To run the backend without local virus scanner: docker compose up

You should be able to access the local dev env on localhost:5173

Let me know if the above works!

bunsy-0900 commented 1 month ago

Thank @kevin9foong. Without the virus-scanner, I am able to run the project. However, is there any specific solution to run the virus-scanner?

kevin9foong commented 1 month ago

The virus-scanner should work. Can you try running npm --prefix serverless/virus-scanner install again? This command should be run from the root folder of FormSG. (it seems the error logs show that the path cannot be found)

After that, you can try running npm run dev:virus-scanner

bunsy-0900 commented 1 month ago

I tried npm --prefix serverless/virus-scanner install. However, the error still occurs as the following

npm warn deprecated @types/pino@7.0.5: This is a stub types definition. pino provides its own type definitions, so you do not need this installed.
npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm warn deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated superagent@7.1.6: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731)
npm error code 2
npm error path /mnt/.../FormSG/serverless/virus-scanner/node_modules/aws-lambda-ric
npm error command failed
npm error command sh -c ./scripts/preinstall.sh
npm error libtoolize: putting auxiliary files in '.'.
npm error libtoolize: copying file './ltmain.sh'
npm error libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
npm error libtoolize: copying file 'm4/libtool.m4'
npm error libtoolize: copying file 'm4/ltoptions.m4'
npm error libtoolize: copying file 'm4/ltsugar.m4'
npm error libtoolize: copying file 'm4/ltversion.m4'
npm error libtoolize: copying file 'm4/lt~obsolete.m4'
npm error libtoolize: Remember to add 'LT_INIT' to configure.ac.
npm error checking whether to enable maintainer-specific portions of Makefiles... no
npm error checking whether make supports nested variables... yes
npm error checking whether to enable debug build options... no
npm error checking whether to enable compiler optimizer... (assumed) yes
npm error checking whether to enable strict compiler warnings... no
npm error checking whether to enable compiler warnings as errors... no
npm error checking whether to enable curl debug memory tracking... no
npm error checking whether to enable hiding of library internal symbols... yes
npm error checking whether to enable c-ares for DNS lookups... no
npm error checking whether to disable dependency on -lrt... (assumed no)
npm error checking whether to enable ECH support... no
npm error checking for path separator... :
npm error checking for sed... /usr/bin/sed
npm error checking for grep... /usr/bin/grep
npm error checking for egrep... /usr/bin/grep -E
npm error checking for ar... /usr/bin/ar
npm error checking for a BSD-compatible install... /usr/bin/install -c
npm error checking for gcc... gcc
npm error checking whether the C compiler works... yes
npm error checking for C compiler default output file name... a.out
npm error checking for suffix of executables... 
npm error checking whether we are cross compiling... no
npm error checking for suffix of object files... o
npm error checking whether the compiler supports GNU C... yes
npm error checking whether gcc accepts -g... yes
npm error checking for gcc option to enable C11 features... none needed
npm error checking whether gcc understands -c and -o together... yes
npm error checking how to run the C preprocessor... gcc -E
npm error checking for a sed that does not truncate output... (cached) /usr/bin/sed
npm error checking for code coverage support... no
npm error checking whether sleep supports fractional seconds... yes
npm error checking filesystem timestamp resolution... 0.01
npm error checking whether build environment is sane... yes
npm error checking for a race-free mkdir -p... /usr/bin/mkdir -p
npm error checking for gawk... gawk
npm error checking whether make sets $(MAKE)... yes
npm error checking whether make supports the include directive... yes (GNU style)
npm error checking xargs -n works... yes
npm error checking dependency style of gcc... gcc3
npm error checking curl version... 7.83.1-DEV
npm error *** Do not use buildconf. Instead, just use: autoreconf -fi
npm error configure.ac:120: installing './compile'
npm error configure.ac:317: installing './config.guess'
npm error configure.ac:317: installing './config.sub'
npm error configure.ac:120: installing './install-sh'
npm error configure.ac:125: installing './missing'
npm error docs/examples/Makefile.am: installing './depcomp'
npm error parallel-tests: installing './test-driver'
npm error ./configure: line 6793: syntax error near unexpected token `;;'
npm error ./configure: line 6793: ` ;;'

npm error A complete log of this run can be found in: /home/name/.npm/_logs/2024-10-09T03_20_40_590Z-debug-0.log
bunsy-0900 commented 1 month ago

Upgrading the package aws-lambda-ric solves the issue.