Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

ErrorCorner

ErrorCorner Logo ErrorCorner Logo

ErrorCorner Navigation

  • Home
  • Contact Us
  • About Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Contact Us
  • About Us

Kenil Vasani

Ask Kenil Vasani
0Followers
646Questions
Home/ Kenil Vasani/Answers
  • About
  • Questions
  • Polls
  • Answers
  • Best Answers
  • Followed Questions
  • Favorite Questions
  • Groups
  1. Asked: December 22, 2020

    How can I solve error gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config?

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    TL;DR Use the Visual Studio Installer to get the Desktop development with C++ workload in one of the Visual Studio versions you have installed in your machine: Reason/Details Reading through the log, the main error is due to this: msvs_version not set from command line or npm config After this one yRead more

    TL;DR

    Use the Visual Studio Installer to get the Desktop development with C++ workload in one of the Visual Studio versions you have installed in your machine:

    VS workloads

    Reason/Details

    Reading through the log, the main error is due to this:

    msvs_version not set from command line or npm config

    After this one you find a few of these:

    “Visual Studio C++ core features” missing

    And later:

    You need to install the latest version of Visual Studio including the “Desktop development with C++” workload.

    For more information consult the documentation at:

    VS https://github.com/nodejs/node-gyp#on-windows

    Finally:

    Could not find any Visual Studio installation to use

    So to solve the problem, you just need to get “Desktop development with C++” workload.

    If you have a Visual Studio version installed

    1. open Visual Studio Installer (Win + search for it)
    2. on the list displayed with all Visual Studio Installations you have in your PC, press the Modify button of one of them (preferably the latest version)
    3. on the Workloads grid/list select the checkbox with Desktop development with C++
    4. Press one of the Install buttons

    gyp will then find that version and use it:

    gyp info find Python using Python version 3.8.1 found at “C:\Users\USER\AppData\Local\Programs\Python\Python38-32\python.exe”

    gyp info find VS using VS2019 (16.4.29709.97) found at:

    gyp info find VS “C:\Program Files (x86)\Microsoft Visual Studio\2019\

    With NO Visual Studio installed

    Disclaimer: I did not test any of these solutions.

    Alternative 1

    As Hamid Jolany’s answer suggests, on an admin shell, simply install the build tools package globally (node-gyp README):

    npm i -g windows-build-tools
    

    Alternative 2

    Ragavan’s idea/answer for avoiding installing Visual Studio has some logic:

    1. verify if you have VS build tools by running npm config get msvs_version (if you have, skip to step 4 and attempt setting the environment variables)
    2. if not installed, get the VS build tools latest version exe and install it (Ragavan’s idea was with or Microsoft Build Tools 2015)
    3. run npm config set msvs_version 2019 --global (or npm config set msvs_version 2015 --global according to Ragavan’s idea)
    4. (optional? I have VS installed and do not have this variable declared) set the VCTargetsPathenvironment variable (Win + search for var) to the appropriate path (e.g. C:\Program Files (x86)\MSBuild\Microsoft\Portable\v5.0) or through Run as Admin terminal, as in Ragavan’s idea with the 2015 Build Tools:
    • set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
    • or in Powershell: $env:VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140

    Side notes:

    • a previous error might be resolved by installing Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019;
    • you might also want to restart after installing any of the above
    See less
    • 7
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  2. Asked: December 22, 2020

    Cloud Functions for Firebase: ‘Error: could not handle the request’

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    You are seeing Error: could not handle the request since there probably was an exception and it timed out. Check your logs using: firebase functions:log Refer docs for more details Here's how I got URL unshortening to work const functions = require('firebase-functions'); const admin = require('firebRead more

    You are seeing Error: could not handle the request since there probably was an exception and it timed out.

    Check your logs using:

    firebase functions:log
    

    Refer docs for more details

    Here’s how I got URL unshortening to work

    const functions = require('firebase-functions');
    
    const admin = require('firebase-admin');
    admin.initializeApp(functions.config().firebase);
    
    const http = require('http');
    const urlP = require('url');
    
    const unshorten = (url, cb) => {
      const _r = http.request(
        Object.assign(
          {},
          urlP.parse(url),
          {
            method: 'HEAD',
          }
        ),
        function(response) {
          cb(null, response.headers.location || url);
        }
      );
      _r.on('error', cb);
      _r.end();
    };
    
    const resolveShortUrl = (uri, cb) => {
      unshorten(uri, (err, longUrl) => {
        if (longUrl === uri) {
          cb(null, longUrl);
        } else {
          resolveShortUrl(longUrl, cb);
        }
      });
    };
    
    exports.url = functions.https.onRequest((requested, response) => {
      var uri = requested.query.url;
      resolveShortUrl(uri, (err, url) => {
        if (err) {
          // handle err
        } else {
          response.send({ url });
        }
      });
    });
    

    You can follow the hello world example straight away and use the above code as your function.

    Above code uses HEAD requests to peek into ‘Location` field of the headers and decides if the url can be further unshortened.

    This is lighter as HEAD requests ask for no body (thereby avoiding body parsing). Also, no third party lib required!

    Also note that the url passed as a query param. So the request would be

    http://<your_firebase_server>/url?url=<short_url>
    

    Saves you the trouble of URL re-writes. Plus semantically makes a little more sense.

    See less
    • 8
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  3. Asked: December 22, 2020

    Unable to install node-sass in my project

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    Uninstall node-sass: npm uninstall node-sass Delete package-lock.json, and clean the cache: npm cache clean --force, then do npm update, npm install, npm update. then again try to install node sass: npm install node-sass. If this doesn't work, Try to rebuild node-sass: npm rebuild node-sass If thatRead more

    Uninstall node-sass: npm uninstall node-sass
    Delete package-lock.json, and clean the cache: npm cache clean --force, then do npm update, npm install, npm update. then again try to install node sass: npm install node-sass.

    If this doesn’t work, Try to rebuild node-sass:

    npm rebuild node-sass
    

    If that too doesn’t work then i suggest to delete package-lock.json, node-modules and npm cache folder and do npm install , to install all your dependencies again. make sure you have a package.json file with all your dependencies listed.

    The package-lock.json file has some issues(it doesn’t update when package.json changes) as mentioned here:https://github.com/npm/npm/issues/16866
    “Touching package.json by hand may make your package.json to be incompatible with package-lock.json”. do npm update to update the package-lock.json file.
    to completely disable package-lock creation:
    npm config set package-lock false

    See less
    • 5
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  4. Asked: December 22, 2020

    Build:Cannot find type definition file for ‘node’

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    I had several problems updating packages through visual studio. From now i always update or add packages with the powershell console. Start PowerShell and navigate to the folder where package.json is located and then run npm install Restart visual studio after the installation is done. You can alsoRead more

    I had several problems updating packages through visual studio. From now i always update or add packages with the powershell console.

    Start PowerShell and navigate to the folder where package.json is located and then run npm install Restart visual studio after the installation is done.

    You can also try to delete your node_modules folder then run npm install

    Hope this will solve your problems.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  5. Asked: December 22, 2020In: ReactJs

    React Proxy error: Could not proxy request /api/ from localhost:3000 to http://localhost:8000 (ECONNREFUSED)

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    So the issue was since both the Node dev environment and the Django dev environment were running in separate docker containers, so localhost was referring to the node container, not the bridged network. So the key was to use container links, which are automatically created when using docker-compose,Read more

    So the issue was since both the Node dev environment and the Django dev environment were running in separate docker containers, so localhost was referring to the node container, not the bridged network.

    So the key was to use container links, which are automatically created when using docker-compose, and use that as the hostname. So I changed it to

    "proxy": {
        "/api":  {
            "target": "http://django:8000"
        }
    },
    

    And that worked, as long as you launch both containers with the same docker-compose command, otherwise you have to manually specify external_links in your docker-compose.yml file.

    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: December 22, 2020

    npm ERR! Error: connect ECONNREFUSED

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config' See: https://docs.npmjs.com/cli/config More info: How to setup Node.js and Npm behind a corporate web proxy

    If you are behind a proxy, please make sure that the npm ERR! ‘proxy’ config is set properly. See: ‘npm help config’

    See:

    • https://docs.npmjs.com/cli/config

    More info:

    • How to setup Node.js and Npm behind a corporate web proxy
    See less
    • 9
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  7. Asked: December 22, 2020In: Javascript

    jQuery is not defined for angular 2

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    You need to import jquery with angular-cli. Edit your angular-cli.json file. Find script array and add jquery. "scripts": [ "../node_modules/jquery/dist/jquery.min.js" ],

    You need to import jquery with angular-cli.
    Edit your angular-cli.json file.

    Find script array and add jquery.

    "scripts": [
         "../node_modules/jquery/dist/jquery.min.js"
    ],
    
    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  8. Asked: December 22, 2020

    NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    Try deleting the package-lock.json file.

    Try deleting the package-lock.json file.

    See less
    • 8
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  9. Asked: December 22, 2020In: Javascript

    NPM ELIFECYCLE error – using node server.js command

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    Sometimes, when you already started your web server, the ELIFECYCLE error comes if you try to run the npm command again on another terminal (cmd). Make sure that you don't have any other instance running up in the same port. Try to clean your cache with: npm cache clean with Administrator/root and dRead more

    Sometimes, when you already started your web server, the ELIFECYCLE error comes if you try to run the npm command again on another terminal (cmd). Make sure that you don’t have any other instance running up in the same port.

    Try to clean your cache with: npm cache clean with Administrator/root and delete your node_modules, after this steps, try to install your packages again with npm install --save

    See less
    • 5
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: December 22, 2020

    Installing npm package fails with 404

    Kenil Vasani

    Kenil Vasani

    • 646 Questions
    • 567 Answers
    • 77 Best Answers
    • 26 Points
    View Profile
    Best Answer
    Kenil Vasani
    Added an answer on December 22, 2020 at 7:07 am

    npm config set registry http://registry.npmjs.org NPM registry documentation

    npm config set registry http://registry.npmjs.org
    

    NPM registry documentation

    See less
    • 7
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 2 3 4 5 6 … 57

Sidebar

Ask A Question
  • Popular
  • Kenil Vasani

    SyntaxError: invalid syntax to repo init in the AOSP code

    • 5 Answers
  • Kenil Vasani

    runtimeError: package fails to pass a sanity check for numpy ...

    • 3 Answers
  • Kenil Vasani

    xlrd.biffh.XLRDError: Excel xlsx file; not supported

    • 3 Answers
  • Kenil Vasani

    Homebrew fails on MacOS Big Sur

    • 3 Answers
  • Kenil Vasani

    SQLSTATE[HY000]: General error: 1835 Malformed communication packet on LARAVEL

    • 2 Answers

Explore

  • Most Answered
  • Most Visited
  • Most Voted
  • Random

© 2020-2021 ErrorCorner. All Rights Reserved
by ErrorCorner.com