npm ERR! code 1
npm ERR! path /home/ubuntu/app/client/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /home/ubuntu/.nvm/versions/node/v15.8.0/bin/node /home/ubuntu/app/client/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/home/ubuntu/.nvm/versions/node/v15.8.0/bin/node',
npm ERR! gyp verb cli '/home/ubuntu/app/client/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ubuntu/app/client/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ubuntu/app/client/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ubuntu/app/client/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:196:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ubuntu/app/client/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ubuntu/app/client/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ubuntu/app/client/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:196:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ubuntu/app/client/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ubuntu/app/client/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ubuntu/app/client/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:196:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ubuntu/app/client/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ubuntu/app/client/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ubuntu/app/client/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ubuntu/app/client/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:196:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (/home/ubuntu/app/client/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (/home/ubuntu/app/client/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack at F (/home/ubuntu/app/client/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack at E (/home/ubuntu/app/client/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack at /home/ubuntu/app/client/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack at /home/ubuntu/app/client/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /home/ubuntu/app/client/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:196:21)
npm ERR! gyp ERR! System Linux 5.11.0-1020-aws
npm ERR! gyp ERR! command "/home/ubuntu/.nvm/versions/node/v15.8.0/bin/node" "/home/ubuntu/app/client/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/ubuntu/app/client/node_modules/node-sass
npm ERR! gyp ERR! node -v v15.8.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-11-29T15_16_27_299Z-debug.log
package.json
"node-sass": "4.12.0",
Everything works perfectly on my local machine and I have also replicated the same environment:
hostnamectl
Static hostname: ip-172-31-27-21
Icon name: computer-vm
Chassis: vm
Machine ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Boot ID: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Virtualization: kvm
Operating System: ]8;;https://www.ubuntu.com/Ubuntu 20.04.3 LTS]8;;
Kernel: Linux 5.11.0-1020-aws
Architecture: x86-64
node -v
v15.8.0
By reading the log, I noticed python was not installed.
So I installed it like this:
sudo apt install python2
python2 -V
Python 2.7.18
Now, when I run npm i
, I don't get the original error but this is what gets logged at the end:
Killed ] | reify:@material-ui/icons: timing reify:audit Completed in 16866ms
Next, I run npm start
, and this was logged:
Starting the development server...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
So as requested, I ran:
npx browserslist@latest --update-db
And this is what got logged:
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Latest version: 1.0.30001283
Installed versions: 1.0.30001040, 1.0.30001239
Removing old caniuse-lite from lock file
Installing new caniuse-lite version
$ npm install caniuse-lite
Cleaning package.json dependencies from caniuse-lite
$ npm uninstall caniuse-lite
caniuse-lite has been successfully updated
Target browser changes:
- and_chr 91
+ and_chr 96
- and_ff 89
+ and_ff 94
- android 4.4.3-4.4.4
- chrome 90
- chrome 89
- chrome 88
- chrome 85
- chrome 49
+ chrome 95
+ chrome 94
+ chrome 93
+ chrome 92
- edge 91
- edge 90
+ edge 95
+ edge 94
- firefox 88
+ firefox 93
+ firefox 92
- ios_saf 14.5-14.6
- ios_saf 12.2-12.4
+ ios_saf 15
+ ios_saf 14.5-14.8
+ ios_saf 12.2-12.5
- opera 76
- opera 75
+ opera 80
+ opera 79
- safari 8
+ safari 15
- samsung 13.0
+ samsung 15.0
Now, after I ran npm start
again, this is what gets logged:
Starting the development server...
<--- Last few GCs --->
[13463:0x47f2fe0] 44444 ms: Scavenge 429.9 (463.2) -> 429.5 (466.4) MB, 3.2 / 0.0 ms (average mu = 0.719, current mu = 0.528) allocation failure
[13463:0x47f2fe0] 44450 ms: Scavenge 432.6 (466.4) -> 432.6 (467.2) MB, 1.6 / 0.0 ms (average mu = 0.719, current mu = 0.528) allocation failure
[13463:0x47f2fe0] 44454 ms: Scavenge 433.3 (467.2) -> 433.0 (470.2) MB, 2.8 / 0.0 ms (average mu = 0.719, current mu = 0.528) allocation failure
<--- JS stacktrace --->
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
1: 0xa747f0 node::Abort() [node]
2: 0x9a1c4d node::FatalError(char const*, char const*) [node]
3: 0xc5d08e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xc5d407 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xe26c95 [node]
6: 0xe56223 v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [node]
7: 0xe62dd6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [node]
8: 0xe4eeff v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [node]
9: 0xe4f178 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [node]
10: 0xe40f99 v8::internal::ItemParallelJob::Run() [node]
11: 0xe64d60 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [node]
12: 0xe655a3 v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [node]
13: 0xe65965 v8::internal::MarkCompactCollector::Evacuate() [node]
14: 0xe780d1 v8::internal::MarkCompactCollector::CollectGarbage() [node]
15: 0xe33f98 v8::internal::Heap::MarkCompact() [node]
16: 0xe35928 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
17: 0xe38ecc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
18: 0xdfcb2a v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
19: 0xdf6034 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
20: 0xdf8471 v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node]
21: 0x11eec2c v8::internal::IncrementalStringBuilder::Extend() [node]
22: 0xf22700 v8::internal::JsonStringifier::SerializeString(v8::internal::Handle<v8::internal::String>) [node]
23: 0xf2828a v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
24: 0xf266e0 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
25: 0xf28aa8 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
26: 0xf2a47f v8::internal::JsonStringify(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
27: 0xd09b0f v8::internal::Builtin_JsonStringify(int, unsigned long*, v8::internal::Isolate*) [node]
28: 0x14ea9d9 [node]
npm ERR! code 1
npm ERR! path /home/ubuntu/app/client
npm ERR! command failed
npm ERR! command sh -c react-scripts start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-11-29T15_37_34_902Z-debug.log
This is deeply frustrating as usually I can deploy the app easily. Now, I've been stuck all day trying to do this simple thing.
I have done all of this before in a different VPS provider and it worked fine. Now, I am migrating to AWS EC2, and I am stuck here.
Any help will be very much appreciated!