insidesherpa / JPMC-tech-task-3-PY3

8 stars 176 forks source link

Failed to Compile error #68

Open ayushraja01 opened 3 years ago

ayushraja01 commented 3 years ago

I used the npm install and npm start and it opened up on the browser but it gave me an error on the browser.

Failed to compile /Users/ayushraja/JPMC-tech-task-3-PY3/src/Graph.tsx Type error: Cannot find module '@jpmorganchase/perspective'. TS2307

1 | import React, { Component } from 'react';

2 | import { Table } from '@jpmorganchase/perspective'; | ^ 3 | import { ServerRespond } from './DataStreamer'; 4 | import { DataManipulator } from './DataManipulator'; 5 | import './Graph.css';

On the npm install this is what showed up.

bufferutil@3.0.5 install /Users/ayushraja/JPMC-tech-task-3-PY3/node_modules/bufferutil prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=11.0.0 runtime=node arch=x64 platform=darwin) No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected! gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/ayushraja/.nvm/versions/node/v11.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Darwin 19.6.0 gyp ERR! command "/Users/ayushraja/.nvm/versions/node/v11.0.0/bin/node" "/Users/ayushraja/.nvm/versions/node/v11.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/ayushraja/JPMC-tech-task-3-PY3/node_modules/bufferutil gyp ERR! node -v v11.0.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN bootstrap@4.2.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. npm WARN bootstrap@4.2.1 requires a peer of popper.js@^1.14.6 but none is installed. You must install peer dependencies yourself. npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bufferutil@3.0.5 install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bufferutil@3.0.5 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/ayushraja/.npm/_logs/2020-10-20T00_24_16_774Z-debug.log

kevinbui904 commented 3 years ago

Hey kinda late. But if you're still having issues with this I'd recommend just yoinking the node_modules folder from the shared drive (https://drive.google.com/drive/folders/1wzIlt-OeiK6nYEHidsOGlpJ_KmeoPVXz). You can also find this on the main tech3 github link.

Also, remember to delete the node_modules folder before you extract the files else npm (I just right click --> delete but if you're fancy rm -rf node_modules in command prompt work for some folks)

But yeah for some reason npm install doesn't want to install private dependencies, still got no idea why but at least yoinking the entire list off google drive worked LOL

Miguel-7 commented 3 years ago

Try downloading the 'node_modules' folder through the link provided in the JPMC slides (I think it does not make any difference if you just use the same ones from task 2, at least that's what I did and it worked just fine. I think the file in task 3 is the same). Then, to overcome this error messages, copy the 'node_modules' folder to your 'JPMC-tech-task-3-PY3' folder. After this, go to your terminal/cmd programme and change the directory to the folder 'C:\Users\xxxxx\JPMC-tech-task-3-PY3\node_modules', and then, type in and enter the 'npm start' command. This should solve the 'Failed to compile' error related to 'npm install/npm start' that some people are facing. I guess the trick here it to use the 'JPMC-tech-task-3-PY3\node_modules' folder in the directory instead of the 'JPMC-tech-task-3-PY3' folder when we are entering these commands. I hope this helps.

kanthonye commented 3 years ago

You only need to copy the folder "@jpmorganchase" inside the downloaded "node_modules" and paste it into the node_modules you downloaded via git. The reason is that the downloaded "node_modules" folder has fewer files than the one you downloaded via git, which means the downloaded "node_modules" folder is missing other things.