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:
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:
run npm config set msvs_version 2019 --global (or npm config set msvs_version 2015 --global according to Ragavan’s idea)
(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
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.
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
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
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
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.
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’
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.
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
How can I solve error gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config?
Kenil Vasani
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:
Reason/Details
Reading through the log, the main error is due to this:
After this one you find a few of these:
And later:
Finally:
So to solve the problem, you just need to get “Desktop development with C++” workload.
If you have a Visual Studio version installed
gyp will then find that version and use it:
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):
Alternative 2
Ragavan’s idea/answer for avoiding installing Visual Studio has some logic:
npm config get msvs_version
(if you have, skip to step 4 and attempt setting the environment variables)npm config set msvs_version 2019 --global
(ornpm config set msvs_version 2015 --global
according to Ragavan’s idea)VCTargetsPath
environment 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
$env:VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
Side notes:
Cloud Functions for Firebase: ‘Error: could not handle the request’
Kenil Vasani
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:
Refer docs for more details
Here’s how I got URL unshortening to work
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
Saves you the trouble of URL re-writes. Plus semantically makes a little more sense.
See lessUnable to install node-sass in my project
Kenil Vasani
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 donpm 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:
If that too doesn’t work then i suggest to delete
package-lock.json
,node-modules
andnpm cache
folder and donpm 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
See less“Touching package.json by hand may make your package.json to be incompatible with package-lock.json”. do
npm update
to update thepackage-lock.json
file.to completely disable package-lock creation:
npm config set package-lock false
Build:Cannot find type definition file for ‘node’
Kenil Vasani
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 wherepackage.json
is located and then runnpm install
Restart visual studio after the installation is done.You can also try to delete your
node_modules
folder then runnpm install
Hope this will solve your problems.
See lessReact Proxy error: Could not proxy request /api/ from localhost:3000 to http://localhost:8000 (ECONNREFUSED)
Kenil Vasani
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 toAnd that worked, as long as you launch both containers with the same
See lessdocker-compose
command, otherwise you have to manually specify external_links in yourdocker-compose.yml
file.npm ERR! Error: connect ECONNREFUSED
Kenil Vasani
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:
More info:
jQuery is not defined for angular 2
Kenil Vasani
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
See lessscript
array and add jquery.NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS
Kenil Vasani
Try deleting the package-lock.json file.
Try deleting the
See lesspackage-lock.json
file.NPM ELIFECYCLE error – using node server.js command
Kenil Vasani
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 thenpm
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:
See lessnpm cache clean
with Administrator/root and delete yournode_modules
, after this steps, try to install your packages again withnpm install --save
Installing npm package fails with 404
Kenil Vasani
npm config set registry http://registry.npmjs.org NPM registry documentation
NPM registry documentation
See less