npm install etimed out error - php

I have been facing this issue all day long, so I decided to get help from some experts out here. When I run a command npm install from the root of the directory of my laravel project using cmd with following config..
1. Windows 7 64-bit
2. xampp
3. Firewall turned off
4. No anti-virus software
5. Not using any proxy server for sure (Have checked it)
C:\xampp\htdocs\gulp_test>npm install npm ERR!
Windows_NT 6.1.7600 npm ERR! argv "node"
"C:\Users\Varun\AppData\Roaming\npm\node_modules\npm \bin\npm-cli.js" "install"
npm ERR! node v0.12.7 npm ERR! npm v2.13.1 npm ERR!
code ETIMEDOUT
npm ERR!
errno ETIMEDOUT
npm ERR! syscall connect
npm ERR!
network connect ETIMEDOUT
npm ERR!network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings.
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! Please include the following file with any support request: npm ERR! C:\xampp\htdocs\gulp_test\npm-debug.lognetwork npm ERR!network npm ERR!
I only get this error when I run npm install or npm install laravel-elixir but not when I run npm install gulp or npm install express.
When I run npm install it installs a folder named node_modules under root directory, but it does not install folder LARAVEL-ELIXIR. Could it be because of the above mentioned error?
I have also tried the following options to get GULP working
npm cache clean
Re-install node
Running npm install gulp , npm install laravel-elixir
individually one after another
composer update
Connecting my personal hotspot instead of WiFi, in case there
would have been some network related issue.
Tried almost every suggestion on stackoverflow and google.
But none of the above worked.
Any suggestions as of what can be done to get npm install function as it should?

I have finally managed to get rid of the error. It had to do something with package.json file. After a fresh installation of laravel 5 the content of package.json were as below.
{
"private": true,
"devDependencies":
{
"gulp": "^3.8.8"
},
"dependencies":
{
"laravel-elixir": "^2.0.0",
"bootstrap-sass": "^3.0.0"
}
}
I changed the content to below and it worked.
{
"devDependencies":
{
"gulp": "^3.8.8",
"bootstrap-sass": "^3.0.0",
"laravel-elixir": "^2.0.0"
}
}

Related

npm install AND npm run dev Returns npm ERR! code E404

I just downloaded Laravel 9 and tried to run npm run save && npm run dev but this error occurs on the Terminal:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://skimdb.npmjs.com/registry/AND - not_found
npm ERR! 404
npm ERR! 404 'AND#*' is not in this registry.
npm ERR! 404 This package name is not valid, because
npm ERR! 404 1. name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User 1\AppData\Local\npm-cache\_logs\2022-12-17T09_18_19_657Z-debug-0.log
So what's going wrong here?
I tried running npm config set registry https://skimdb.npmjs.com/registry but again the error appears!
So what's going wrong here?
How can I solve this issue?
UPDATE #1:
package.json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"#popperjs/core": "^2.11.6",
"axios": "^1.1.2",
"bootstrap": "^5.2.3",
"laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"sass": "^1.56.1",
"vite": "^4.0.0"
}
}
It is better to reinstall Laravel
If the error still persists, try testing with vpn again
Try removing .npmrc file and reinstalling node. Hope it works :)

'mix' is not recognized as an internal or external command in Laravel 8 new installation

I have installed a new Laravel 8 application, and then I ran...
npm install
Afterward, I ran...
npm run dev
I get the following error.
'mix' is not recognized as an internal or external command
> # dev E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> npm run development
> # development E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> mix
'mix' is not recognized as an internal or external command, operable
program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm
ERR! # development: `mix` npm ERR! Exit status 1 npm ERR! npm ERR!
Failed at the # development script. npm ERR! This is probably not a
problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-01-18T17_03_24_944Z-debug.log
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! # dev: `npm run
development` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the #
dev script. npm ERR! This is probably not a problem with npm. There is
likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-01-18T17_03_24_980Z-debug.log
Likely you need to install the latest version of Laravel Mix.
npm install laravel-mix#latest --save-dev
It will happen when your cache holds previous files.Clear the cache and install the npm again
npm cache clean --force
then:
npm install
npm fix audit
then:
npm run development
my problem was solved by following these steps
npm install --g laravel-mix
npm install --g webpack-cli
NPM INSTALL
it will repair it
It hapenned because you have some stuff installed after previous NMP I
So, in any strange situation - NPM INSTALL again)
package.json requires you to run mix-watch command but it doesnt work
a simple fix that worked for me is running npm run watch it worked for me laravel 8 project
If you are a windows user try this :
C:\Users{{your-username}}\AppData\Roaming\npm-cache
then :
npm cache verify

Error when using react and laravel mix

I'm running into a problem when I'm trying to get react to work with my laravel project.
I'm using Homestead on windows. While ssh'd into my virtual server, and I'm in the root of my project I have run
composer install
php artisan preset react
npm install && npm run dev
I am then getting the following errors
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN img-loader#3.0.0 requires a peer of imagemin#^5.0.0 but none was installed.
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none was installed.
npm ERR! Linux 4.4.0-92-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! path ../acorn/bin/acorn
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/home/vagrant/www/todo/node_modules/.bin/acorn'
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! /home/vagrant/www/todo/npm-debug.log
In my assets/js/components a react example.js has been added.
I'm not too sure where to go with this so any help would be appreciated
This is a problem with symbolic links creation between your host (windows) and VM.
First thing, you don't need to issue these commands via ssh, you can safely run them on your windows host (all changes will be silently copied back to your homestead VM machine - this is just how homestead works)
Secondly, depending on your VirtualBox installation some issues with symbolic links may arise. If that's the case, check if you are using the latest versions of VirtualBox and Homestead.
Then if still having problems, please check this thread

How do I update my Nodejs in laravel dev. to LTS

How do I update my Node to LTS? I keep getting errors when I try "npm install" in my terminal. Please help
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to
find it in the tree.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Goodness\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--no-bin-links"
npm ERR! node v4.4.6
npm ERR! npm v3.10.9
npm ERR! code ENOGIT
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\event\npm-debug.log

Can't install Laravel 4 Grunt

I'm getting this error when running this command: sudo php artisan grunt:setup
I'm running Ubuntu 13.04 and using laravel 4.
I have no idea what to do now...
mikkel#mikkel-K53SV-Linux:/var/www/forum$ sudo php artisan grunt:setup
A gruntfile.js or package.json file already exist and will be replaced. Do you want to continue? [yes|no]yes
Node and NPM are installed. Continue...
Do you require CSS preprocessing? [yes|no]y
Which CSS preprocessor do you require? [less|sass|stylus]l
I did not recognize that preprocessor. Please try again. [less|sass|stylus]less
package.json & gruntfile.js successfully created!
Installing / updating required grunt plugins...
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-contrib-compress
npm http GET https://registry.npmjs.org/grunt-contrib-concat
npm http GET https://registry.npmjs.org/grunt-contrib-cssmin
npm http GET https://registry.npmjs.org/grunt-contrib-jshint
npm http GET https://registry.npmjs.org/grunt-contrib-less
npm http GET https://registry.npmjs.org/grunt-contrib-sass
npm http GET https://registry.npmjs.org/grunt-contrib-stylus
npm http GET https://registry.npmjs.org/grunt-contrib-livereload
npm http GET https://registry.npmjs.org/grunt-contrib-uglify
npm http GET https://registry.npmjs.org/grunt-contrib-watch
npm http GET https://registry.npmjs.org/grunt-notify
npm http GET https://registry.npmjs.org/grunt-phpunit
npm http GET https://registry.npmjs.org/grunt-contrib-clean
npm http 200 https://registry.npmjs.org/grunt-contrib-cssmin
npm ERR! Error: No compatible version found: grunt-contrib-cssmin#'>=0.6.1- <0.7.0-'
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /var/www/forum/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-32-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/forum
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: grunt-contrib-cssmin#'>=0.6.1- <0.7.0-'
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/forum/npm-debug.log
npm not ok
Fixed it!
I just had to re-install node.js.

Categories