Any suggestions how to install grunt in windows behind a proxy? - visual-studio-2013

I'm trying to install grunt on a windows machine that is behind a corporate proxy.
I have installed node and npm, I can see the versions of both of them from the command line. But when I try to install grunt as is described in the grunt site http://gruntjs.com/getting-started but I get the following errors and I can't figure it out how to solve it.
Here is the Error message I get:
npm.cmd: npm ERR! Error: CERT_UNTRUSTED
At line:1 char:4 + npm <<<< install -g grunt-cli + CategoryInfo : NotSpecified:
(npm ERR! Error: CERT_UNTRUSTED:String) [], RemoteException + FullyQualifiedErrorId:
NativeCommandError
npm ERR! at SecurePair.<anonymous> (tls.js:1367:32), npm ERR! at SecurePair.emit (events.js:92:17), npm ERR! at SecurePair.maybeInitFinished (tls.js:979:10), npm ERR! at CleartextStream.read [as _read] (tls.js:471:13), npm ERR! at CleartextStream.Readable.read (_stream_readable.js:340:10), npm ERR! at EncryptedStream.write [as _write] (tls.js:368:25)
npm ERR! at doWrite (_stream_writable.js:225:10), npm ERR! at writeOrBuffer (_stream_writable.js:215:5), npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:182:11), npm ERR! at at write (_stream_readable.js:601:24), npm ERR! If you need help, you may report this *entire* log, npm ERR! including the npm and node versions, at: npm ERR! <http://github.com/npm/npm/issues>, npm ERR! System Windows_NT 6.1.7601, npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli"
npm ERR!cwd C:\Dev\gruntTest2, npm ERR! node -v v0.10.31, npm ERR! npm -v 1.4.23
I am using visual studio 2013. I have tried installing direct from the command line and from the Package Manager Console, and basically I get the same error.
Any suggestions how to solve this?
Thanks in advance.

In order to be able to install grunt or anything else from npm, first I need to use the following command:
npm config set strict-ssl false
I found this answer in different places around stackoverflow and other sites. But I used as a reference Ramesh answer. I also include the proxy address of the network, but that didn't work until I change strict-ssl configuration.

You could run a proxy on your own system ( fiddler can function as a proxy)
and point your browser proxy settings to this proxy.
Because fiddler is started under your credentials, proxy authentication is no longer a problem.
Remember to restart programs after you change the proxy settings

Related

Error Installing Angular 4 using git Bash

hey i was installing angular and waiting 11 hours and then internet slow down and i got an error
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/resolve/-/resolve-
1.8.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network
settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2018-07-
06T21_01_53_610Z-debug.log
what should i do??How to complete the installation successfully?
Update node and npm
Run PowerShell as Administrator
npm install -g npm-windows-upgrade
npm-windows-upgrade
Then try angular cli
npm install -g #angular/cli

Error installing and using laravel mix

I want to install Mix in laravel . I run "npm install --no-bin-links" in my IDE terminal or in CMD but I get this error: (my laravel version is 5.4.27)
D:\wamp64\www\laravelProject>npm install --no-bin-links
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--no-bin-links"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! Maximum call stack size exceeded
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! D:\wamp64\www\laravelProject\npm-debug.log
I found!!
I remove node-modules then removed package-lock.json and ran
The following command helped me too:
npm cache clean --force
Also, you might need to add sudo in linux.

Sails.js won't install. Windows

Sails.js will not install, but just to make sure npm is working I installed grunt
npm install -g grunt-cli and it installed correctly.
But when I run npm install -g sails I get an error.
Command prompt error:
`sails#0.11.0 preinstall C:\Users\User\AppData\Roaming\npm\node_modules\sails
node ./lib/preinstall_npmcheck.js
Sails.js Installation - Error
Unable to check your npm-version
Please reinstall npm to use Sails.js
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-
cli.js" "-g" "install" "sails"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! sails#0.11.0 preinstall: node ./lib/preinstall_npmcheck.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sails#0.11.0 preinstall script 'node ./lib/preinstall_npmcheck.js'.
npm ERR! This is most likely a problem with the sails package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/preinstall_npmcheck.js
npm ERR! You can get their info via:
npm ERR! npm owner ls sails
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log`
npm-debug.log:
https://gist.github.com/anonymous/c850ac8c71e0410db020
I got the same errors.
npm -g install sails
But it worked when I ran command line as administrator.
I solved this by running npm install -g sails --ignore-scripts.
The only thing I can think of is for some reason I don't have ./lib/preinstall_npmcheck.js file and it is trying to run it, so by ignoring it I don't get the error, hence the successful install.
I still don't understand why, but I hope this helps someone.

Certain NPM installs fail with EPERM 50 (Gulp and others)

I continue to get permissions errors on Windows 7 when trying to npm install certain modules. A global install of gulp for example results in this:
c:\Users\abc\Documents\uniform\UniServer\www\ur>npm install -g gulp
/
> v8flags#1.0.1 install C:\Users\abc\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags
> node fetch.js
flags for v8 3.14.5.9 cached.
npm ERR! Error: EPERM, open 'C:\Users\abc\Documents\uniform\UniServer\www\npmcache\c14291c8-che-
ansi-regex-0-2-1-package-tgz.lock'
npm ERR! { [Error: EPERM, open 'C:\Users\abc\Documents\uniform\UniServer\www\npmcache\c14291c8-
che-ansi-regex-0-2-1-package-tgz.lock']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\Users\\abc\\Documents\\uniform\\UniServer\\www\\npmcache\\c14291c8-che-ans
i-regex-0-2-1-package-tgz.lock' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\n
pm\\bin\\npm-cli.js" "install" "-g" "gulp"
npm ERR! cwd c:\Users\abc\Documents\uniform\UniServer\www\ur
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\abc\Documents\uniform\UniServer\www\npmcache\c14291c8-che-ansi-regex-0-2-
1-package-tgz.lock
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open 'C:\Users\abc\Documents\uniform\UniServer\www\npmcache\c14291c
8-che-ansi-regex-0-2-1-package-tgz.lock'
npm ERR! not ok code 0
I get this error while running cmd as administrator. I've read in other SO posts that this may represent a missing program. git is installed and works so it's not that. bower is installed and works. I've tried adding c:\windows\system32 to the system PATH. No help. As you may be able to tell, I modified the location of my NPM cache thinking that perhaps the folder it was in by default had some sort of permissions issue. No help there either. I've tried adding the --no-bin-links option, doesn't help. I'm really at a loss as to what is causing this problem. Have the same issue trying to install slush-mongo, either globally or locally.
I had the same problem and found these command-line flags that seem to fix it without having to disable AV:
npm install --cache-lock-retries 1000 --cache-lock-wait 100000
You can change the default values (so you don't need to add the command-line options every time) by running:
npm config set cache-lock-retries 1000
npm config set cache-lock-wait 100000
Turns out that our company's anti-virus software was actually causing it. We attempted to do exclusions of node.exe and our working directory but both were insufficient. We have to disable the AV software, perform the install, and then re-enable AV.
I had the same problem, Which I was able to resolve by opening the command prompt or GIT Bash using RUN AS ADMINISTRATOR OPTION.
STEP 1: Right click on cmd.exe (search cmd in windows) or GIT Bash.
STEP 2: Click on Run as Administrator.
STEP 3: Execute >npm install command

Mac npm erroring with ENOENT

I'm a recent convert to Mac from Windows, and currently just trying to get my tools setup.
I first installed node using homebrew, which was giving me errors (same as what I still have). I later removed node using homebrew and installed using the pkg from the node website.
I can access node in the command line and npm. The problem is when I try to install modules on the project locally I get something like:
npm install grunt-contrib
Error extracting archive { [Error: ENOENT, open '/Users/davidmckeown/dev/adt-com/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip']
errno: 34,
code: 'ENOENT',
path: '/Users/davidmckeown/dev/adt-com/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip' }
Another message just above that contains:
npm ERR! phantomjs#0.2.6 install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 8
npm ERR!
npm ERR! Failed at the phantomjs#0.2.6 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.2.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-contrib"
npm ERR! cwd /Users/davidmckeown/dev/adt-com
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
Any help figuring out what is causing problems here would be fantastic. This happens with other modules too, from what I can tell.
npm cache clean
or if installed under su
sudo npm cache clean
There was an issue 5 months ago with grunt qunit package - https://github.com/gruntjs/grunt-lib-phantomjs/issues/5.
Try to install this specific package:
sudo npm install grunt-contrib-qunit
The package that you installed is a bundle of many packages. The qunit package version was not updated explicitly to the latest version in this bundle, that's why clearing the npm cache might solve this issue.

Resources