brpapa / recursion-tree-visualizer

🌳 Input the source code of any recursive function in javascript, python or golang and visualize its recursion tree
https://recursion.vercel.app
MIT License
475 stars 65 forks source link

Internal server error and Can't install projects locally #5

Closed Bollie15 closed 3 years ago

Bollie15 commented 3 years ago

Hi, when I run my custom function, I met some troubles.

def fn(idx,step):
    if idx < 0 or idx >= arrLen:
        return 0
    if 0 == step:
        return 0 == idx
    return (fn(idx - 1, step - 1) + fn(idx + 1, step - 1) + fn(idx, step - 1)) % 1000000007

And global variable is steps = 3, arrLen = 2

  1. https://recursion.vercel.app/ image

  2. install this project by Nodejs

    
    PS D:\NodeJS\recursion-tree-visualizer-master\packages\web> npm install
    npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

core-js@2.6.12 postinstall D:\NodeJS\recursion-tree-visualizer-master\packages\web\node_modules\babel-runtime\node_modules\core-js node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

core-js@3.9.1 postinstall D:\NodeJS\recursion-tree-visualizer-master\packages\web\node_modules\core-js node -e "try{require('./postinstall')}catch(e){}"

core-js-pure@3.9.1 postinstall D:\NodeJS\recursion-tree-visualizer-master\packages\web\node_modules\core-js-pure node -e "try{require('./postinstall')}catch(e){}"

ejs@2.7.4 postinstall D:\NodeJS\recursion-tree-visualizer-master\packages\web\node_modules\ejs node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 2032 packages from 799 contributors and audited 2036 packages in 204.781s

137 packages are looking for funding run npm fund for details

found 167 moderate severity vulnerabilities run npm audit fix to fix them, or npm audit for details

PS D:\NodeJS\recursion-tree-visualizer-master\packages\web> npm audit fix npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1 package from 1 contributor, removed 1 package and updated 3 packages in 12.588s

137 packages are looking for funding run npm fund for details

fixed 88 of 167 vulnerabilities in 2036 scanned packages 79 vulnerabilities required manual review and could not be updated PS D:\NodeJS\recursion-tree-visualizer-master\packages\web> npm run start

web-client@1.0.0 start D:\NodeJS\recursion-tree-visualizer-master\packages\web react-scripts start

There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

"eslint": "^7.11.0"

Don't try to install it manually: your package manager does it automatically. However, a different version of eslint was detected higher up in the tree:

D:\NodeJS\recursion-tree-visualizer-master\packages\web\node_modules\eslint (version: 6.8.0)

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem. If this has not helped, there are a few other things you can try:

  1. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead. This may help because npm has known issues with package hoisting which may get resolved in future versions.

  2. Check if D:\NodeJS\recursion-tree-visualizer-master\packages\web\node_modules\eslint is outside your project directory. For example, you might have accidentally installed something in your home folder.

  3. Try running npm ls eslint in your project folder. This will tell you which other package (apart from the expected react-scripts) installed eslint.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! web-client@1.0.0 start: react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the web-client@1.0.0 start 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! C:\Users\007\AppData\Roaming\npm-cache_logs\2021-05-13T02_54_00_621Z-debug.log


I don't quite understand how to solve this problem, I hope to get your help, thank you. 😥
brpapa commented 3 years ago

Hi.

  1. The code was not allowing returns beyond numbers. Now is allowing any type.
  2. To fix it, just add a .env file to the package base directory with SKIP_PREFLIGHT_CHECK=true.

Thanks for the issue.