Browser-sync error on all projects after reinstalling Windows - npm

After reinstalling Windows 10, I get the following error upon launching gulp watch:
Error: listen EADDRINUSE :::3000 at Object._errnoException (util.js:992:11) ... at module.exports.plugin (D:\xampp\htdocs\blagnac\wp-content\themes\blagnac\gulp\node_modules\browser-sync\dist\server\index.js:27:25)
I tried npm install browser-sync --save-dev, I tried npm install, and I tried npm rebuild. Nothing works. Any idea?

The error is telling you that there is already a process running in port 3000.
Option 1 (preferred)
In order to run gulp watch on port 3000, you need to kill the existing process that is running on port 3000.
The steps for killing a process are given in this SO answer.
Option 2
An alternative would be change the port in which gulp runs from 3000 to something else say 3001.

Related

Expo Error starting tunnel Failed to install #expo/ngrok#^2.4.3 globally

I'm trying to run expo with a tunnel connection and I keep getting the following error:
Error starting tunnel Failed to install #expo/ngrok#^2.4.3 globally: npm exited with non-zero code: 243
I've tried installing this version of ngrok globally and just within my project as well as removing it to allow expo to do the install automatically. It did run successfully once by starting the project with expo start instead of npm start but this seems to no longer work.
run npm install #expo/ngrok#2.4.3
Install ngrok and run it in terminal using this command ngrok http 3000.
Then in other terminal run expo start.
It will work surely.
The instructions are not intuitive, so here is a fix:
npm install #expo/ngrok
brew install ngrok
ngrok http 3000
expo start --tunnel
Wish Expo simplifies this; they shouldn't have a button that says "tunnel" if there is an entire setup that's not properly explained.

Yeoman, npm install errors registry

When trying the Excel Addin Tutorial (https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=yeomangenerator) I get an error when running npm start :
> office-addin-taskpane-js#0.0.1 start D:\sheet_organizer
> office-addin-debugging start manifest.xml
Debugging is being started...
App type: desktop
Enabled debugging for add-in sheet_organizer. Debug method: 0
Starting the dev server... (webpack-dev-server --mode development)
The dev server is running on port 3000. Process id: 8456
Sideloading the Office Add-in...
Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in.
Error: Unable to delete registry value "D:\sheet_organizer\manifest.xml" in key "HKCU\SOFTWARE\Microsoft\Office\16.0\Wef\Developer".
ProcessUncleanExitError: DELETE command exited with code 1:
Error: can't find the key or the value
I check manually the key. There is a Developper>05c2e1c9-3e1d-406e-9a91-e9ac64854143 folder
With UseDirectDebugger, UseLiveReload and UseWebDebugger
So the key exist. Don't understand why it is not working.
Yes, this issue was fixed. OfficeDev/Office-Addin-Scripts#215
Please get the latest version of office-addin-debugging.
There are a couple of ways to do this.
1- npm update --dev can update all packages according to semver. (You can see outdated packages using npm outdated --long.)
2- You could update office-addin-debugging package using npm install -D office-addin-debugging.
Ref:https://github.com/OfficeDev/office-js-docs-pr/issues/1321

YARN START gives no space left on device error

OS : UBUNTU 18.04
I created a simple create-react-app project then fired up a server using yarn start. 30% of the times it works fine but 70% of the times I get the following error.
Starting the development server...
events.js:167
throw er; // Unhandled 'error' event
^
Error: ENOSPC: no space left on device, watch '/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/public'
at FSWatcher.start (internal/fs/watchers.js:164:26)
at Object.watch (fs.js:1232:11)
at createFsWatchInstance (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:155:5)
Emitted 'error' event at:
at FSWatcher._handleError (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:39:5)
at setFsWatchListener (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[... lines matching original stack trace ...]
at FSReqWrap.oncomplete (fs.js:155:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I'm clueless on how this error comes up. I have literally nothing stored on my laptop and around 90% Harddisk is free. The working directory has nearly 200+ GB free space. I also tried starting the project by copying the entire project into different locations(different drives too) but none worked. Also, tried npm start but that too did not work.
Try removing your node_modules folder, then using NPM to install ('npm i') and run ('npm run start'), instead of Yarn.
I received the same error, preventing me from running my Node project using Yarn. I tried Node v10.10.0 and v8.12.0.
Removing my node_modules folder and reinstalling with Yarn did not help.
I had a similar issue. Solved it by increasing the number of inotify watches. using assistance here:
https://github.com/parcel-bundler/parcel/issues/1427
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
By using:
sudo sysctl fs.inotify.max_user_watches=999999999
and persisted using:
echo fs.inotify.max_user_watches=999999999 | sudo tee -a /etc/sysctl.conf
sudo sysctl --system
You need to check your Node.js version.
As documentation say You’ll need to have Node >= 6 on your local development machine

Protractor installed in offline mode - error for webdriver-manager start - what am I doing wrong

I need to install and use Protractor / Selenium on the machine without Internet access.
To do that, I've tried to download all needed files and copy them to the destination machine.
On my machine (with Internet access)
I installed Protractor and Selenium webdriver with the following command:
npm install -g protractor
webdriver-manager update
On destination machine (without Internet access)
I copied all files from the location returned by npm config get prefix to the computer without Internet access.
Then I executed following command on the machine without Internet access:
npm --cache-min 9999999 install -g protractor
which seems to succeed.
However, when I try to execute webdriver-manager start command, I receive following error message:
events.js:183
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND chromedriver.storage.googleapis.com
chromedriver.storage.googleapis.com:443
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
I receive the same error when executing webdriver-manager update (as in this case: webdriver-manager start: Error: connect ETIMEDOUT)
Question
What am I doing wrong? How should I properly setup Protractor and webdriver on the machine without Internet access?
Because webdriver-manager start will look up the latest version number of selenium-server.jar and webdriver binaries through internet no matter they are already exists on local.
But webdriver-manager not supply cmd option to disable the looking up.
The quick way is to run the java cmd behind webdriver-manager start directly to skip the looking up.
java
-Dwebdriver.chrome.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\chromedriver_2.38.exe
-Dwebdriver.gecko.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\geckodriver-v0.20.1.exe
-jar C:\Tools\npm-global\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.11.0.jar
-port 4444
The complex way is to change webdriver-manager code or setup a mirror on local and use cmd option: --alternate_cdn and point it to your local mirror url. ( I didn't verify this can work, get it after read some source code)

How to stop angular-cli freezing on "loadRequestedDeps: silly install loadAllDepsIntoIdealTree"?

I am running Windows 8.1 with node version 7.7.3 and npm version 4.1.2.
I have been working on an Angular tutorial without issues. At some point since finishing that tutorial I installed Python. I am not sure if it is related, but I have mentioned it just in case.
Today I am trying to create an Angular application and it hung without completing.
I did some research and it tells me to do this:
npm uninstall -g #angluar/cli
npm cache clean
npm install -g #angular/cli
The last command hangs at this point:
loadRequestedDeps: silly install loadAllDepsIntoIdealTree
I opened the command prompt "run as administrator" to run these commands.
Everything I try fails. I have connected to a completely different network to eliminate that as the problem and that didn't fix anything. I have uninstalled and reinstalled node.js and that hasn't fixed the problem either.
I can ping registry.npmjs.org just fine.
What is causing this error?
I finally found the answer! I ran the following command in the command window:
echo %temp%
It had 3 temp paths in there. I removed the two I didn't need and voila, it works!