lb4 command is not found in Windows 10 - npm

I have install loopback 4 framework in my system by this command npm i -g #loopback/cli. But after installation by terminal I, can't create loopback application because it showing lb4 command not found. I also search through web and do many changes in environment variables but got same problem. I have executed this command with different terminal and same problem is getting.
I have attachments which will help you to understand the problem
I am running this command on command prompt in windows 10 system

This can occur for several reasons; Typically, it's caused by a misconfigured PATH variable or a stale "cache" of the terminal. A quick solution is to use npx #loopback/cli instead.

Related

Stuck in Network azure-iot-edge-dev is external, skipping

Runing the Build and Run Iot Edge Solution in Simulator stopped working suddenly, and the log builds the containers and stops at this message Network azure-iot-edge-dev is external, skipping Everything was working fine 5mins ago, tried rebooting, restarting docker, iotedgehubdev, but in vain. Do you know how can I get more logs and/or resolve this problem ?
This is a generic error that is thrown for a variety of reasons.
Possible causes can be:
Proxy blocking pulling images of edgeHub and edgeAgent
A problem in the deployment.template.json (or debug template), e.g. missing brackets
Ports of edgeHub that are in use
Docker configured for Windows containers when targeting Linux or visa-versa
The Build output or IoT hub output in Visual Studio usually gives a bit more information.
Do you know how can I get more logs and/or resolve this problem ?
Are you trying to debug/simulate it locally on windows 10 machine?
When you need to gather logs from an IoT Edge device, the most convenient way is to use the support-bundle command. By default, this command collects module, IoT Edge security manager and container engine logs, iotedge check JSON output, and other useful debug information. It compresses them into a single file for easy sharing. The support-bundle command is available in release 1.0.9 and later.
Run the support-bundle command with the --since flag to specify how long from the past you want to get logs. For example 6h will get logs since the last six hours, 6d since the last six days, 6m since the last six minutes and so on. Include the --help flag to see a complete list of options.
sudo iotedge support-bundle --since 6h
By default, the support-bundle command creates a zip file called support_bundle.zip in the directory where the command is called. Use the flag --output to specify a different path or file name for the output.
Incase if you are looking to debug the modules locally on VS2019, VS Code below documentations will be useful.
Use Visual Studio 2019 to develop and debug modules for Azure IoT Edge and
Use Visual Studio Code to develop and debug modules for Azure IoT Edge
Please share the complete logs if the above doesn't help.
I have this issue when trying to start a project from within Visual Studio when it's not running in administrator mode. I always forget and end up with this error. Same goes for if I run "iotedgehubdev.exe setup" from a command prompt. It only works when the command prompt is running in administrator mode.

An unexpected error occurred: "EPERM: operation not permitted in Yarn

I am having problems installing new npm packages with Yarn. Every time I go on to add a new package it's throwing me this error. But when I delete my node_modules folder and run Yarn, everything works fine. Again when I try to add another package, it throws me the same error. Any solutions, I am having a headache right now.
In Windows first stop the development server and then try to install package.
I had same problem, I went into the Task Manager (CTRL+SHIFT+ESC) and killed all the NodeJs processes.
Press "Ctrl+C" to stop the server and repeat the installation.
if you're using visual studio code, cmd, or Windows Terminal, close it and run it in administrator mode. Usually, the reason for that error message is a result of limited privilege giving to the editor or npm or Yarn if you're using that.
This is likely due to you creating your project within the windows /mnt directory structure
Rerun inside the ~/home folder
(accessible within windows # //wsl$/
did you try to open CDM as run as administrator or if with wsl terminal try to use sudo like sudo yarn
The package I was trying to install before haveing this issue was yup. So resulted to
yarn add yup --legacy-peer-deps
which worked.
Sometimes when this occurs, you may first try to uncheck node_modules folder to read only.
If it is not working try to stop the running server and install your packages and then restart the server.
Terminate or stop the server ( close and reopen Vscode) and try agin. this will work for me !!
Restarting the system which causes stopping all the processes by Node, VScode, ... solved the problem.

cygwin and BQ CLI not working... "-bash: bq: command not found"

I'm trying to script the loading of some data into GCP using the command line interface and I'm having an issue with cygwin with what i believe is a not complete install of BQ CLI.
From a DOS prompt I'm able to successfully run commands and load data so I believe I have it installed correctly on my desktop, Windows 10 64bit.
Is there some additional installation required to get cygwin to work correctly with BQ CLI that isn't installed by default with cygwin?
Appreciate any assistance.
I found the problem I was having... I was attempting to execute BQ from the cli using 'bq' and not 'bq.cmd'...
Working fine now...

npm search hangs on windows 8.1

I am trying to figure out a problem with WebStorm 8's NPM UI tool. I have come to a point that running "npm search" command line actually hangs. That is what the UI tool runs initially. I am running Windows 8.1. I have also tried running the same command in Windows 7. It actually returns an error running the "npm search" command. I really want to run WebStorm with NPM on windows 8.1.
Same issue on OSX 10.9.4. Via command line, 'npm search' fails with "FATAL ERROR: JS Allocation failed - process out of memory". Via PHPStorm, it just hangs.
If I add an argument after npm search in command line, it works fine.
I don't think it is a Windows only problem. Instead it looks exactly like this reported bug: npm.commands.search fails and dumps 100+ Mb to output log
I can reproduce it on Linux with npm 2.0.2 by simply calling
npm search
(It just hangs and allocates huge amounts of memory)
To quote from the bug report:
We're treating the combined metadata for all packages in the registry as an in-memory database backed by a JSON file. It's already a hefty wad of data to download, parse, and keep in memory, and as the number of packages in the registry grows, it's going to cause more and more problems, especially in resource-constrained environments
Let us hope they can fix it soon.
(Another related bug report is npm search" runs out of memory and dies without good error. Looks like a duplicate to me.)

IntelliJ - Running Program as Sudo

Developing a program on OSX using Java and IntelliJ. Deals with network sockets and ICMP. Hence, the program needs to be run as root or sudo'd on OSX. Program runs fine from a terminal window outside IntelliJ under sudo. However, I would like to debug and run it from IntelliJ (V9). In IntelliJ it errors (I need root privs to enumerate network devices). I know how to pass program and VM parameters in IntelliJ but now how to hit Run and/Debug and have it run under sudo? What is needed is basically sudo java ...... MyProgram instead of java ..... MyProgram Any ideas or workarounds.
I came out with an answer and wanted to share it just in case anyone else runs into this. To solve the problem, I took my cue from what I do with QT & QT Creator when doing network programming.
On OSX, I opened up a terminal window and cd'd down to/Applications/IntelliJ IDEA 9.0.3.app/Contents/MacOS. There you will find a file called idea which launches the IDE. I ran that as sudo (sudo ./idea). That took care of permissions on anything Intellij launched and I could debug and step through my code as needed.
sudo /Applications/IntelliJ IDEA 9.0.3.app/Contents/MacOS/idea
Since this is a dev machine and I am in control of it security is not an issue in this case.
Hope it helps someone else out.
Inside a terminal:
sudo -s
give access to the root user.
from there you could run the Idea IDE using the script:
/Applications/IntelliJ\ IDEA*/bin/idea.sh
and in this way I'm able to work on network where permission errors where printed before.
Debugging of sudo programs is disallowed by the operating system unless the debugger is running as root, for security reasons.
So, even if you can figure out how to get IntelliJ to use sudo it won't do you any good.
I know this is not what OP directly asked -
In case someone needs to do this on Linux (Ubuntu), e.g. in order to update Idea, just run from command line:
sudo /usr/local/bin/idea
Only make sure once the Update and Restart is finished to actually close Idea and start it normally
I agree with #Darron, it is not recommended to execute IntelliJ with sudo.
You can execute with IntelliJ terminal instead.
I maintain my project in IntelliJ. When I need to execute a unit test that requires sudo access, I just open IntelliJ terminal and type:
sudo gradle test
Good luck!