Is it possible to run a command from a pip installed python cli package within a node package? - package

I want to use the cli commands from openAI's python package in the cli of my node package. Is this possible?
From what I've looked up, I know you can run general shell commands in javascript using the child_process module. Is there a way I can somehow include the python package as a dependency that gets installed along with my node package, so that I can run its CLI commands using child_process?

Related

Error while using 'new' command while creating a project in gatsby

is the error I get while I'm trying to get a new starter project in gatsby.
node version: v14.4.0
npm version: 6.14.5
gatsby version: 2.4.17
Also, the error is the same while working with recent gatsby version.
Please help or suggest something.
git is not recognized as an internal or external command
You need to install git.
it seems you are using windows so install git on windows
You may need to close the cmd and open it again in order to use git.
Since windows may not automatically add git to your PATH environment variables:
Open Git Bash which should have been installed along with Git if you downloaded the correct installer.
Type the command you want to run, it should start with git.
Press enter.

No `package.json` file found. Make sure you are running the command in a Node.js project

I am building a AngularJS file with typescript and installed tsd for typedefinitions globally. When I try to run the following command on the root of my project folder I am getting an error
I am new Angular JS using version 1.7. I am not sure if Package.json is needed for AngularJS project
Command
tsd install angular --resolve --save
Error
No package.json file found. Make sure you are running the command in a Node.js project.
package.json is required for node projects to specify metadata about project and include some important commands that may be required for the project build. First you have to install node from official website. You can google for the step by step installation. Once installed, goto your project directory and run this command. Make sure to perform "npm init" before you run the desired angular command.
Note: Ensure, node is accessible through cli
tsd is deprecated use #types node modules
npm i #types/angular --save

For react-admin-demo is it compulsory to do complete build of react-admin

For react-admin-demo is it compulsory to do complete build of react-admin.
As per documentation it goes through clumsy make process.
Have anybody installed the folder itself by just npm install and run?
Any hints on how that can be simplified, to fork and create my own project?
Reference: https://github.com/marmelab/react-admin/tree/master/examples/demo
This is a mono repository which includes many packages. It uses learn and yarn workspaces. You'll have to use yarn.
There are several scripts inside the main package.json file which can help you start contributing without make. Each package inside packages can be built by running yarn build inside its folder.
To build all packages in one command, you can run ./node_modules/.bin/lerna run build inside the root folder.

angular directory structure not getting created in IntelliJ

I am following steps in IntelliJ to support Angular.
https://www.jetbrains.com/help/idea/2017.1/using-angular.html#install_angular_cli
In Generating an Angular application stub using Angular CLI section, I have to specify some package_name for Angular CLI field while setting up the project. What should be the value of package_name? I keep getting the following message but the angular directory structure doesn't get created.
"C:\Program Files\nodejs\node.exe" C:...\AppData\Roaming\npm\node_modules\angular-cli\bin\ng new angularIntelliJ8 --dir=.
As a forewarning, we are moving the CLI npm package to "#angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.
To disable this warning use "ng set --global warnings.packageDeprecation=false".
Directory '.' already exists.
Done
I have specified the path as C:\Users\Manu\AppData\Roaming\npm\node_modules\angular-cli
I notice that if I run ng new angularIntelliJ8 on cmd then the angular directory structure gets created. But doing where ng shows the following path for ng
>where ng
C:\..\AppData\Roaming\npm\ng
C:\..\AppData\Roaming\npm\ng.cmd
If I use above paths in Angular CLI, I get error that IntelliJ couldn't find bin/ng
Also, if I run '"C:\Program Files\nodejs\node.exe" C:\Users\Manu\AppData\Roaming\npm\node_modules\angular-cli\bin\ng new angularIntelliJ10' on cmd terminal manually (without --dir=.), the structure gets created.
Am I specifying wrong path for Angular CLI?
Please update angular-cli to the most recent version (see Updating Angular CLI for instructions). Both the package name/location and CLI interface have changed since beta 28, and IDEA 2017.1.* only supports new cli versions.
Once you have a new cli package installed, specify C:\Users\Manu\AppData\Roaming\npm\node_modules\#angular\cli as a package name in New Project wizard

Separating a Build and Test on Jenkins

I have a angular application which i develop using source control ofcourse (gitlab), I recently integrated it with jenkins so that everytime i push to my git it triggers a build. In my jenkins i created a job that pretty much builds the application (installs dependencies) and runs test. Following is what my execute shell looks like in my job.
export npm_config_prefix=.npm/
export PATH=.npm/bin:$PATH
npm install -g bower grunt-cli
npm install
bower install
gulp test
Now the issue is that I do not want to build and run test as a same step i want them to seprate. So how do i achieve this ? Do i create a new job and add gulp test in the execute shell of the new job ? Or is there some other approach. I am new to jenkins and CI in general so was wondering what would be the approach in this situation ?
As you have found, Jenkins is a super advanced shell script runner to take the boring part out of repeatable steps in the build process.
The next step is to hunt down plugins to do those steps for you in a cleaner way. This is where plugins come in
These is a Node Plugin which will install npm packages outside the job so you don't have to do the npm install -g step every single job
You would want to keep the build step as shell
npm install
bower install
gulp test
I think that is your concern because you only need to run the job if the code has changed, including local dependencies. You could add a second shell step and just have the tests in there as it will run in the same workspace but all the build logs will be in one place
You didn't say what test runner your using but you will probably find a publisher step which will bring that into Jenkins for you xUnit plugin covers quite a few runners so might work for you
And this is the tutorial on installing plugins into Jenkins

Resources