i am not able to start angularJS2 project in visual studio sitting behind a proxy server. the following steps which i have done are
installed node.js - v6.9.4
npm version is 3.10.10
set the npm config as
npm config set https-proxy=http://username:password#companyAddress:8080
and also tried this
npm config set https-proxy=http://"username:password"#companyAddress:8080 and also
i have a package.json file which was downloaded from here package.json file downloaded link
now when i run the following command in the command prompt, navigating to the folder of my project, intially i get a loader like this
then it returns a error like this
I have even tried this npm config set proxy "http://domainName%5Cusername:password#company.com:8080/" as suggested here but it didnt work
I have tried all the blogs mentioned in stackoverflow as well as github, but nothing goes beyond the following steps and nothing resolved my issue.
Related
I'm going through a basic tutorial on how to create a Node.Js project in Visual Studio. I create the project and there is an "npm" folder with some packages listed such as : body-parser, cookie-parser, etc. They all have "(missing)" next to them. I've gone through this new project setup a few times. Sometimes when I right click on the package the "Install npm Package" is greyed out. Sometimes it isn't. When it isn't and I select "Install npm package", it does absolutely nothing.
This is a new project. There is no Git repository or anything. This is literally just a new Node.js project straight out of the box. Does anyone know why these npm packages are missing or why I can't install them?
I found this, which isn't related to Sisual Studio, but someone trying to install express via the command line:
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
I found some stuff in the logs about a local cert not found. I had to run npm config set strict-ssl and suddenly it worked.
An alternative answer that was suggested is the following, if you are looking for a better long-term solution:
npm config set registry http://registry.npmjs.org/
I was trying to run npm install inside the project folder but every time there is this error showing npm cb() never called.
I am using node version 10.16.2 and npm version 6.9.0 in windows 10
I have tried npm cache clean --force but that didn't help
E:\contribution\contribute-to-open-source>npm install
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\papun\AppData\Roaming\npm-cache\_logs\2019-08-10T03_51_20_512Z-debug.log
I had the same problems and lost hours trying to solve it :(.
But then i found out that my firm has installed some new kind of firewall with self signed certificate.
Quick solution was:
npm config set strict-ssl=false
After that everything started working without 'npm cb() never called' errors
I had faced the same issue, and i spend days to get a solution for the issue. In the end, i figured it out and it was an issue with my network.
Please verify your network connection and proxy settings.
In my case, I was using corporate proxy using a script. When i opened the pac file and get the proxy from there ( take XXX:XXX from the line return "PROXY XXX:XXX;";) and added to npm config proxy setting (npm config set proxy XXX:XXX), it started working and got resolved.
run this all issue will be solved..
npm install --global windows-build-tools
try to set your proxy using the commands
npm config set proxy http://proxy_host:port
npm config set https-proxy https://proxy_host:port
I have deleted all the node_modules, package-lock.json but still it was not working. For me the reason was, there were some modules that required relogin to install.
So, I deleted my node_modules, build and package-lock.json. and opened command prompt in admin mode.
Then went to the specific project path and logged-in to the components that require credentials.
1. npm login (root path of your react app)
2. type username as "<xxxxx>"
3. type password as "<yyyyy>" (won't be visible on console)
4. type email as "<zzzz>#<aaa>.com"
5. npm i
6. npm run build
It worked for me.
I also faced the same problem I deleted that file from
C:\Users\Harshk1311\AppData\Roaming\npm-cache\_logs
And problem solved
Double Check file name in terminal where error occured and delete file
i.e C:\Users\Harshk1311\AppData\Roaming\npm-cache_logs\2019-08-10T03_51_20_512Z-debug.log
Delete 2019-08-10T03_51_20_512Z-debug.log only this file .
Another possible reason that solved the problem in my case:
Missing MS VC Redistributable. For example if you are on a fresh new PC. In this case you could download the e.g. VC_redist.x64.exe and install it. You may need to restart the terminal before e.g. executing npm i again.
The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.
I have latest Visual Studio 2017 with node v10.4.1, npm v6.1.0.
I can create ASP.NET Core 2.0 React project and NPM dependencies load OK and I can launch the newly created project in a web browser.
However when I create a new ASP.NET Core 2.1 React project, restore of NPM packages fails with:
NPM: ERR! 418 I'm a teapot: acorn#5.3.0
What could be wrong if NPM clearly works well in 2.0 project, but 2.1 NPM restore fails with that silly foolsday error.
.npmrc looks like this:
proxy=http://xxx.xxx.cz:3128/
registry=http://registry.npmjs.org/
strict-ssl=false
A command executed from cmd.exe:
cd %ProgramFiles%\nodejs
npm install npm#latest
ends also with
npm ERR! 418 I'm a teapot: npm#latest
I have also encountered this error for another type of project, on a server that relies on a proxy. I have managed to make it work by using https instead of http for the registry:
registry=https://registry.npmjs.org/
Hm, not sure, whether I should delete this post. It is connected with the issue described here, but should have been fixed a month ago. Apparently anything that goes wrong with proxy servers produces the silly 418 I'm a teapot error. I have removed the line with our proxy server
proxy=http://xxx.xxx.cz:3128/
from the .npmrc config file (in the Users folder), so there remained only
registry=http://registry.npmjs.org/
strict-ssl=false
Now everything went OK and React project with ASP.NET Core 2.1 launches without error.
I admit that the silly error message does not seem funny any longer.
npm set strict-ssl false
npm config set registry https://registry.npmjs.org/
I also got this error in my project and the main reason is change in our proxy settings. So i would like to suggest to check your proxy settings ... few commands which i used to resolve this error...
npm set strict-ssl false
npm config set registry https://registry.npmjs.org/
//additional commands if Npm is behind a corporate web proxy
npm config set https-proxy http://...:8080 (add server proxy address and your port number)
npm config set http-proxy http://...:8080 (add server proxy address and your port number)
I am new to nodejs and i am trying to use that with visual studio code editor. I am unable to install any packages. Getting this below error. I think its something to deal with proxy.
I have tried couple of solutions provided (e.g. changes the npm config etc) over the web but nothing seems to working
if you are behind a proxy it wont work you out.use this code
npm config set proxy http://myproxyblabla:myport
I am not able to install packages using npm. I keep getting error shown in below image.
Using link1, link2, link3 I uninstalled nodejs. After installing the nodejs again, when I run npm config ls command, I can still see proxy details which I added earlier.
How can I ensure that when I uninstall nodejs it also removes all the config files.
I was setting proxy as
npm config set http_proxy=http://myproxy address:8080
which is wrong now I use
npm config set proxy http://myproxy address:8080
and I am able to install packages.