awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
924 stars 399 forks source link

Help Wanted : Building in local #564

Closed arnabghoshTW closed 2 years ago

arnabghoshTW commented 2 years ago

Hello folks, I am following the docs to build the app in my local, but its failing at node run install release command. It seems the npm install cmd is not able to install all the required packages.

 . . . .
 npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp verb cli [
npm ERR! npm ERR! gyp verb cli   '/Users/arnabghs/.nvm/versions/node/v16.14.2/bin/node',
npm ERR! npm ERR! gyp verb cli   '/Users/arnabghs/.npm/_cacache/tmp/git-cloneO1NSGg/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! npm ERR! gyp verb cli   'rebuild',
npm ERR! npm ERR! gyp verb cli   '--verbose',
npm ERR! npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! npm ERR! gyp verb cli   '--libsass_library='
npm ERR! npm ERR! gyp verb cli ]
npm ERR! npm ERR! gyp info using node-gyp@7.1.2
. . . .
  . . . .
 npm ERR! npm ERR! 2 warnings generated.
npm ERR! npm ERR! In file included from ../src/libsass/src/values.cpp:3:
npm ERR! npm ERR! In file included from ../src/libsass/src/values.hpp:4:
npm ERR! npm ERR! ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! npm ERR!         for (const auto numerator : numerators)
npm ERR! npm ERR!                         ^
npm ERR! npm ERR! ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! npm ERR!         for (const auto numerator : numerators)
npm ERR! npm ERR!              ^~~~~~~~~~~~~~~~~~~~~~
npm ERR! npm ERR!                         &
npm ERR! npm ERR! ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! npm ERR!         for (const auto denominator : denominators)
npm ERR! npm ERR!                         ^
npm ERR! npm ERR! ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! npm ERR!         for (const auto denominator : denominators)
npm ERR! npm ERR!              ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! npm ERR!                         &
npm ERR! npm ERR! 2 warnings generated.
npm ERR! npm ERR! env: python: No such file or directory
npm ERR! npm ERR! make: *** [Release/sass.a] Error 127
npm ERR! npm ERR! gyp ERR! build error
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/arnabghs/.npm/_cacache/tmp/git-cloneO1NSGg/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! npm ERR! gyp ERR! command "/Users/arnabghs/.nvm/versions/node/v16.14.2/bin/node" "/Users/arnabghs/.npm/_cacache/tmp/git-cloneO1NSGg/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! npm ERR! gyp ERR! cwd /Users/arnabghs/.npm/_cacache/tmp/git-cloneO1NSGg/node_modules/node-sass
npm ERR! npm ERR! gyp ERR! node -v v16.14.2
npm ERR! npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! npm ERR! gyp ERR! not ok
npm ERR! npm ERR! Build failed with error code: 1
. . . .

So its finally failing while trying to do npm build on dev portal, sh: react-scripts: command not found . If I try to move into dev portal and try to do a npm install it also fails with the same error mentioned above. Could someone please help me understand how I can resolve this ?

Node version : v16.14.2 npm version : 8.7.0 OS : macOS

arnabghoshTW commented 2 years ago

It got resolved when I downgraded to node v14

discoursedigital commented 7 months ago

Node Version 14.21.3 worked to build the project for me. 16 and higher does not look like its compatible.