Less installation failed with npm proxy error - less

i want to use less file, i find many tutorials in internet, and i have a bug with the installation of less. The command invit (Windows) do what you see in the picture. I try to config the proxy with command in stackoverflow similars questions but it's not works.
Thanks
enter image description here

You can change the address of registry. For example:
npm config set registry https://registry.npm.taobao.org
then enter
npm install less -g

Related

AsyncApi Change npm registry url

Is there are command-line switch to point the npm registry to different url? I have created a template and published to our company's registry. When referring the package, it is referring to https://registry.npmjs.org/. I did install the template locally using
C:\>npm install -g #company/asyncapi-csharp-template
C:\>ag DomainServiceA.yml #company/asyncapi-csharp-template -o ouput
and the error response is
Something went wrong:
HttpErrorGeneral: 404 Not Found - GET
https://registry.npmjs.org/#company%2fasyncapi-csharp-template - Not found
Tbh best if you submit issue here https://github.com/asyncapi/generator/issues as normally it should work.
also try to add --debug flag to understand more what is happening with template usage in generator

NPM hanging on installing package 'zos'

Installing an NPM package (in this case 'zos') hangs at :
>npm install zos
fetchMetadata: sill resolveWithNewModule http-https#1.0.0 checking installable status
Seems kind of strange as this has only recently started occurring. Other packages seem not to have this issue...
I am using the following environment:
Arch Linux
Node v11.9.0
NPM v6.9.0
I can install other npm packages without issues (eg, lodash, truffle, web3)
OK, I managed to fix the issue... last week I was having some issues with internet access in a new location with wifi so I had to hack around a bit with my /etc/resolv.conf file to get general internet access again... turns out that while that fixed my general browsing it had a knock on effect on npm installs!
So in summary to fix the issue I replaced my /etc/resolve.conf file which had only the following line in it:
# Generated by NetworkManager
nameserver 192.168.0.1
with a previous version of the file I had saved which had the following contents:
nameserver 127.0.0.53
options edns0
And Walah! Everything works again, including the 'npm install zos'....
Thanks to anyone who was looking into this for me!
Cheers
Rick

ERROr: **npm ERR! Unexpected token < in JSON at position 0 while parsing near '<!DOCTYPE HTML PUBLI...'**

Image I am cloning the sitecore Habitat project to my local machine.
After cloning while running npm install, I am getting this error. I tired in all possible ways from the stack overflow answers, but did not succeed with answers still its showing errors, if anyone known about this please let me know.
ERROr: **npm ERR! Unexpected token < in JSON at position 0 while parsing near '<!DOCTYPE HTML PUBLI...'**
Just delete
package-lock.json file
It works for me.
I getting error like:
I found this solution in another question and worked for me after I set the registry like this:
npm set registry https://registry.npmjs.org/
Setting npm Registery worked for me
npm set registry https://registry.npmjs.org/
This error means there is a proxy in the middle which is denying you access to the Internet.
The error comes from the HTML page that is rendered from the proxy.
You need to check with your network administration to either allow the connection through (an exception), or you have to configure the variable HTTP_PROXY in your environment, which is like this:
http://username:password#proxy.server.com:port
Having tested npm install in several repos with the same error I ran npm cache clean --force and tried again. This is not as severe a solution as deleting all traces of node and reinstalling from the ground up.
I use an npm registry hosted at work for internal npm packages so couldn't change the registry source.
yes , its happned due to proxy setting, if this problem occurs, please check your proxy setting, in my case npm was getting blocked, You need to check with your network administration to either allow the connection through (an exception), or you have to configure the variable HTTP_PROXY in your environment
You need to check all required npm config setup like:
https-proxy=https://username:password#accessdomain:port/
proxy=http://username:password#accessdomain:port
registry=https://registry.npmjs.org/
//If required also add
msbuild_path=C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe
I was getting the same issue. I had un-installed NodeJs and deleted folders npm and npm-cache from Users\username\Appdata\Roaming folder and installed it.
Then set config registry by using command terminal as.
npm config set registry https://registry.npmjs.org/
To give an actual description of the problem and solution:
This happens when the URL set as your npm registry is incorrect (or as others have mentioned, a proxy has got in the way). Either way, you end up trying to download a package from an endpoint displaying HTML, which npm fails to parse as JSON (as one would expect).
You can view the URL for your npm config with
npm config get registry, and set it with npm config set registry https://my.registry.com/ (or https://registry.npmjs.org/ for the public registry)
I tried everything mentioned here. Nothing worked. Then I moved jsonwebtoken dependency to the bottom of package.json ( Below my registy specific dependencies ).
Then it worked!
Spent 6 hours in fixing this. I feel so small now.

How do I "install the modules with `npm install` and run `node index."

I stumbled upon a very desirable tool with some quite esoteric instructions.
This is what I would like to make use of:
https://github.com/MehediH/Bulksplash?ref=producthunt
BulkSplash Folder Contents
I apologise but I must ask for an absolute beginner's explanation - I've been searching for quite some time on how to begin to use a tool like this but the explanations are far too technical.
The only instructions in the readme are "install the modules with npm install and run node index."
Where do I even begin?
Thank you very much for reading!
First you must make sure that you have Node.js installed because you need it to run JavaScript outside of browser.
NPM is a Node Package Manager, as it's name says it helps you to manage packages built for that platform, allowing you to easy download, use and keep up-to-date those packages.
Guide on how everything works is already written on npm official site,
if you follow this link you will find that guide, on first glance it is quite long, but considering your needs you can skip a lot of points.
Just make sure to read everything from 1-10th point of Getting started, there is everything you need to be able to use node.js for your needs.
Thanks for the nudge in the right direction - I'm happily using Bulksplash less than an hour later!
Install this: https://nodejs.org/en/download/
Windows + R, enter CMD and run to open the command line
entering node -v into the command line products output "v8.9.4"
entering npm -v produces "5.6.0" (All is going well.)
put the Bulksplash folder in your user folder C:/Users/Yournamehere, rename bulksplash folder Bulk
enter cd Bulk into command line
enter install npm package
check to see if node_modules folder was added to Bulk folder
receive an error when entering node index into the command line
Error: Cannot find module Request
enter npm install progress
enter node index
Error: Cannot find module Commander
npm install Commander
enter node index
Error: Cannot find module Progress
npm install Progress
node index
Welcome to Bulksplash!
Damn it feels good working this stuff out :)
Entering node index --amount 100 downloads 100 random free images!
Awesome!

npm install node-inspector always suspends

I recently study node and try to use npm to install node-inspector globally. But it always suspends here as following pic
I have changed the registry config for times, but it still doesn't work. Anyone can help? TAT
When npm install is stuck, you can increase verbosity of the output from install.
npm config set loglevel verbose
npm install -g node-inspector
Setting the log level to verbose will output a LOT of information. Based on the output you can find out where the errors/warnings are occurring and resolve them.
If git protocol is somehow involved and git's port is being blocked (TCP 9418), you could use https by doing
git config --global url.https://github.com/.insteadOf git://github.com/
npm install -g node-inspector
As you mentioned, you could use cnpm. Feel free to write your own answer and accept that one since that solved your problem.