Could not start watchman; falling back to NodeWatcher for file system events - ember.js

I get the below error message while I switch between my ember applications:
version: 2.4.2
Could not start watchman; falling back to NodeWatcher for file system events.
Visit ember-cli.com for more info.
Livereload server on http://localhost:49153
Could not serve on http://localhost:4200. It is either in use or you do not have permission.
Here are the packages that I have setup on my machine:
npm --version
2.14.20
bower --version
1.7.7
ember --version
2.4.2
node: 4.4.0
os: linux x64

Ember-cli (starting from release 0.1.3) requires watchman or some other service (e.g. NodeWatcher) for file watching.
You can find this info in the ember-cli release 0.1.3 changelog:
https://github.com/ember-cli/ember-cli/releases/tag/v0.1.3
Although I believe you could use your Ember app without watchman, could you confirm that you already have watchman installed?
If not, here's what works fine for me in Ubuntu 64bit:
// installing watchman from source
git clone https://github.com/facebook/watchman.git
cd watchman
./autogen.sh
./configure
make
sudo make install
if you still have problems after installing try also resetting your watchman configuration:
watchman watch-del-all
watchman watch-del /home/myproject // your project folder goes here...
watchman watch-project /home/myproject // your project folder goes
full installation instructions regarding watchman can also be found here
https://facebook.github.io/watchman/docs/install.html

Related

Brew install watchman on mac does run the service

I am on Mac ventura 13.0.1 (22A400)
I am trying to install watchman however it is not getting installed as a service that can be run in service/daemon mode
brew install watchman
==> Downloading https://formulae.brew.sh/api/cask.json
Warning: watchman 2023.02.13.00 is already installed and up-to-date.
To reinstall 2023.02.13.00, run:
brew reinstall watchman
However, it says that it cannot be run and loadable
brew services info watchman
watchman (homebrew.mxcl.watchman)
Running: ✘
Loaded: ✘
Schedulable: ✘
Brew services list
brew services list
Name Status User File
memcached started xxx ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist
rabbitmq started xxx ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist
redis none
stunnel none
However I can use watchman in command line mode, but other programs that need to find watchman can't use it

Expo won't build with locally installed NPM packages

I am using expo#43.0.3 (and expo-cli#5.0.3) to manage my react native project and I have to install an npm package from local source:
$ npm install /path/to/mypackage
In my package.json the package is successfully linked via
"dependencies": {
...
"myPackage": "file:../../mypackage",
...
}
I can also confirm the package works when installing to a new plain node project (same node version 14.8.2)
Now when I start expo via expo start and navigate to the app it does not throw any error but only a warning:
› Reloading apps
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
When using the package from registry everything builds, however.
I tried to use the private packages section form the expo docs, but they only describe how to use private packages from registry but not local.
Anything I'm missing here?
edit:
After resetting the expo network adapters it loads the bundle but it now says it can't find the package:
Unable to resolve module myPackage from /home/user/path/to/myPackage/file.js: myPackage could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
However, I'm not using watchman and I'm not using yarn and rmoving metro- folders from /tmp did not make a difference.
As it turned out in this issue on GitHub it can be solved via npm pack:
run npm pack inside of your library and then npm install path/to/the/packed/file.tgz from your project
Which worked fine for the setup I described in the question.

VSTS Bower not found

We are using Visual Studio Team Services for build and deployment of several sites. Some .NET and some are not. All working fine when using the hosted agent. Due to performance issues and long queue times for the hosted agent we need to use our own build agent.
Here comes the problem:
When running the VSTS builds we get an error when running bower:
******************************************************************************
Starting: bower install
******************************************************************************
C:\Program Files (x86)\nodejs\npm.cmd install -g bower
C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\bower -> C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\node_modules\bower\bin\bower
bower#1.7.9 C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\node_modules\bower
Not found bower: null
******************************************************************************
Finishing: bower install
******************************************************************************
The problem is that bower is actually in that location:
And here are the actual bower build step:
How can we fix this Not found bower: null error?
There are known issues with tools installed into profile folders it has to do with permissions. It's easier to install the tool from an administrative console with the -g parameter. And ensure that the central NPM version is added to the service or system's %path% environment variable.
Or pass in a specific location by adding additional parameters to the call to npm: npm install --prefix "$(Agent.WorkFolder)" Bower Then specify the same location in the Advanced section of the Bower task.
Bower CLI location: $(Agent.WorkFolder)\node_modules\
(You'd need to check the exact location the package is installed to, I'm slightly guessing at the moment ;)).

Ember JS: define is not defined

I recently upgraded my app from Ember 1.3 to Ember 2.4.2. However after deploying it to my production environment with ember build --env production I noticed a couple of issues.
The first issue was that each script/stylesheet tag had a integrity attribute attached to it which made it impossible to load those resources. After some investigation I decided to just replace the value for those attributes to be empty. This allowed the app to download the resources but I then noticed an error in the console that said define is not defined on the minified website.js file that Ember creates. I'm unable to replicate this issue locally because the app runs fine. What steps can I additionally take to investigate this issue? Could this be related to some addon that I have installed, or maybe the SRI integrity attribute that I removed?
Edit: I just tried building and deploying a vanilla app with Ember (e.g. ember new testApp and ember build --env production and encountered the same issue. Is there an issue with Ember that I don't know about? I don't think it's my server since I'm able to render a plain index.html just fine.
I prefer to use the latest NodeJS (v5.8) and the latest npm.
You can update your npm with npm install -g npm.
The best way to install NodeJS
I guess, you have the latest ember-cli. You can update it if you are outside of your project:
$ cd ~
$ npm install -g ember-cli
I just cloned your repository.
$ git clone https://github.com/uioporqwerty/website.git
$ cd website
$ npm install && bower install
$ ember server
Got the following error:
➜ website git:(master) ember s
version: 2.4.2
The Broccoli Plugin: [ConfigLoader] failed with:
Error: Attempting to watch missing directory: config
at EventEmitter.Watcher_addWatchDir [as addWatchDir] (/Users/szines/projects/temp/website/node_modules/broccoli-sane-watcher/index.js:90:11)
at /Users/szines/projects/temp/website/node_modules/ember-cli-broccoli/lib/builder.js:95:35
...
Because of a couple of important files are missing from your ember-cli project, I just run ember init
$ ember init
During this process you see a question. You can check suggested changes with 'd', but it would just remove bootstrap and font-awesome, which is fine, because we will reinstall them with ember install.
[?] Overwrite bower.json? (Yndh) Y
Now we remove all the previous bower and npm package, temp folder and dist folder.
$ rm -rf bower_components node_modules tmp dist
$ npm install && bower install
Install ember-bootstrap and ember-font-awesome:
$ ember install ember-bootstrap
$ ember install ember-font-awesome
Launch the server:
$ ember server
Your app working like a charm. Open localhost:4200 in your browser.
You can build the production:
$ ember build --prod
And all the files will be in /dist folder.
Or run the production version with the server:
$ ember server --prod
Enjoy your new Ember! :)
Update:
You can use ember-cli-update for updating your Ember app:
$ npx ember-cli-update
$ npx ember-cli-update --run-codemods
Source: Update Ember.js app
Zoltan's answer was very helpful in being a part of the solution to my problem. After fixing my local website according to Zoltan's answer I noticed some issues.
First, there was the following error with Ember-Cli 2.4.2:
Could not find module ember-data/-private\system\references\record imported from ember-data/-private/system/references
This issue has been resolved in the master branch of the Github repo for ember-cli but it hasn't made its way to the npm repo. So what I did was uninstall ember-cli with npm remove -g ember-cli and then followed the development instructions on the github repo https://github.com/ember-cli/ember-cli. This fixed that issue.
Additionally, I noticed that my nginx server was not serving js and css files; I tested this by creating a index.html with test.css and test.js and noticed that the server wasn't dishing out those files. Instead of trying to find the issue I noticed my nginx was a bit out of date on my RPI, it was at version 1.6.x, so I thought this would be a good time to update it; I updated it to 1.9.7 by first removing the old version then running this script https://gist.github.com/MattWilcox/402e2e8aa2e1c132ee24. After that I had nginx 1.9.7 but I did somehow have apache2 installed which caused its own headaches with recognizing the default website so I removed it.
Finally, since my settings were overridden I restored /etc/nginx from an rsync backup I have of my pi by just copying over that directory.
Then boom, everything worked. It took a while but everything seems to be working great at https://www.uioporqwerty.com and the qualsys lab report is working fine too https://www.ssllabs.com/ssltest/analyze.html?d=www.uioporqwerty.com so all my settings carried over correctly :)
Glad to have Ember-Cli working correctly.

Loopback lb-ng (LoopBack Angular SDK command-line tool) not working

I'm going through the tutorials of http://docs.strongloop.com, and I've reached http://docs.strongloop.com/display/public/LB/Add+a+client+app.
Yet when I execute 'lb-ng ../server/server.js js/lb-services.js' I get an error: Cannot find module 'loopback'.
Any help would be appreciated!
For the new version of loopback you need to install lb-ng command with this line of command
sudo npm install -g loopback-sdk-angular-cli
also try to be in the client folder make sure that you have js directory in client directory then execute these lb-ng commad
lb-ng ../server/server.js js/lb-services.js
it will work
:)
did you npm install your dependencies? check and see if you have a node_modules dir in your project root.
if you're using a newer version of node, try uninstalling node and reinstalling an LTS version.
npm uninstall -g strongloop
npm cache clear
npm install -g strongloop
This is how I fixed this problem for me.
install strong loop and then run lb-ng command this is how i fixed this problem