angular directory structure not getting created in IntelliJ - angularjs

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

Related

How to run an existing REACT project

Beginner here, please help.
(1)If I have the files of a react project which was built on codesandbox or by another dev, how do I run the app and make changes in VSCode on my own machine.
(2)How do I run an existing personal create-react-app project on my machine, so as to continue buliding?
Open a terminal on vscode, then make sure you already node installed.
Type npm install after that npm run start or whatever command to run, you can see on package.json.
The first thing you need is to install updated version of nodejs, you can type to google “download nodejs” and make sure you download the stable version.
You need to open a terminal, also make sure you can locate your file path then type:
cd your file path: your-appName (this should be the name of your app)

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

How to write Protractor test scripts using Typescript along with Jasmine framework in Visual studio Code?

My project is going from standalone to Web, Our new WebSite is getting created in AngularJS so Protractor is the tool selected for Test Automation.
I want to Integrate Typescript with dependencies of Jasmine and Node so that I don't get errors such as
cannot find name Describe
cannot find name it
cannot find name Expect
Can Anyone tell me how to add Jasmine and Protractor dependencies, so that when I hit ctrl + space i'll get all options available.
I have installed Typescript. And I am getting protractor dependencies such as browser, element, by etc.
What should i do for describe,it,expect (Jasmine stuffs) ?
I use Visual Studio Code everyday to write my scripts, it's my current favourite editor for Protractor because of its built in support for TypeScript!
Here are the following things which can come into my mind which could help you setup your framework-
Download the latest VS Code version - https://code.visualstudio.com/download
Install typescript globally npm install -g typescript
Install protractor globally npm install -g protractor
Create your project folder
Setup you project folder for git, node and typescript -
npm init -f // will create default package.json stating its nodejs project
git init // will create .git file, you project is now git project
tsc --init // will create tsconfig.json stating its typescript project
Install typings and dev dependencies-
npm install --save-dev protractor // this will install protractor as a dev dependency
npm install --save-dev typescript // this will install typescript as a dev dependency
npm install --save-dev #types/jasmine // jasmine typings
npm install --save-dev #types/node // node typings
At this point you have setup your basic protractor-typescript project and you can see all the typings and dependencies in package.json. Now you are good to write your typed scripts :).
Now compile your scripts by running -
tsc or tsc -w
After successfull compilation all your javascript files would be generated.
The run protractor
protractor config.js
You can also setup your vs code for debugging with protractor which I have mentioned here - Protractor -VS Code Debugging
For more details pls refer the TypeScript Tutorial, Protractor API
The Typescript error you are observing this is due to VS Code not recognizing global typescript 2.0 version.
To solve this open vscode go to preferences--> user settings --> settings.json will be opened and enter the highlighted path as shown
Save your file and restart VSCode now you are good to go :)
I agree with the answers given. Just want to share a hack with you.
You don't need to transpile your Typescript codes to JavaScript anymore.
Create a launch.js file
require('ts-node').register({
compilerOptions: {
module: 'commonjs'
},
disableWarnings: true,
fast: true
});
exports.config = require('./config/protractor.conf.ts').config;
And kick start protractor execution like:
> protractor launch
You can save yourself from the headache of transpiling every time you make a change to typescript files.
Happy testng!

Can't build the angular 2 github project

I have forked the angular 2 github repo, clone it in my desktop, add upstream then run npm install, but when I want to build ($(npm bin)/gulp build) i have an error message:
"Task 'build' is not in your gulpfile"
How can I properly build the project?
Try gulp build.sh for more recent versions. You can also run simply ./build.sh from the base directory. For future reference you can see a list of gulp tasks using gulp -T.
Make sure you're using the correct version of node (use nvm if you need to) as described in the developer guide.

Resources