Angular-phonecat getting started (Bower install) fail - angularjs

my problem is described in the following image:
The main problem is that im getting a: Bower ENOENT no bower.json present error and as you can see in the image (second command) the file is actually present. So ive been trying to find what actually bower install does and havent found it in the NPM documentation and Git documentation as well
Also, in the research ive done some forums suggest installing bower globally and it hasnt worked
Since i've been googling for about 3 nights looking for somebody with the same problem and havent found anybody else with the problem I started wondering about if I changed any environment variable. So i uninstalled node.js and Git and then reinstalled both programs without any change in the result
Hope somebody can help me with this, thanks in advance

Bower is a package manager for HTML http://bower.io/. 'bower install' will download all the packages listed in bower.json and add them to a folder called 'bower_components'
You must have bower install globally via
npm install -g bower
To get a list of NPM packages installed successfully global use:
npm list -g
Having a look at the github issues of that Repository(Angular-phonecat) theres alot of issues related to bower(https://github.com/angular/angular-phonecat/search?q=bower&type=Issues&utf8=%E2%9C%93), which is strange because bower is not that complicated. Have you looked through any of those fixes.

Related

Simple NPM Question Re-updating local react project after other dev added new package

I just started working with vscode and npm/git. Someone on my team added a package and I did a pull to get his latest changes which put that package in my package.json file. When I ran the project I got errors for a module not being found. Obviously I need to install that package locally. Do I simply use npm install w/no arguments to get it? Or do I install it manually myself with npm install and version info? I ask because I don't know if npm install w/no args will create a new package.json or cause any issues.
What is the correct way to get a new package installed that someone added in the repo?
npm install can be run as many times as you like, and is what you should be doing here :)
npm install's purpose is to get your node_modules folder up-to-date with whatever is written in package.json
So, if your colleague has changed package.json (by installing something new and pushing the change to git), you can just run the command again to get up-to-date.
Provided you haven't directly fiddled with any files in node_modules (this folder should be left alone), it is always safe to run npm install as many times as you like, even if nothing has changed.

Error while running ‘hello-react’ program in react.js

With lots of issues while installing react.js finally when I thought that issues were resolved and everything is in a good place. I found this as a heartache issue.
Error description Image for reference:
Whenever you see this error, it means that something went wrong when you installed the dependencies.
The proper method to fix this error and install all the dependencies again can be found in this answer.
A quick workaround can be to install this specific dependency again using the following npm command:
npm intall react-scripts start
This will help you solve this issue. I still recommend you to install all the dependencies again so that you won't run into such issues later on.
Please mark this answer as accepted if it solves your issue.
Please execute the below-mentioned command.
npx i -g create-react-app
It takes few minutes and displays a message similar to below
We suggest that you begin by typing:
cd your-app-name
yarn start
Happy hacking!
cd into the your-app-name folder and execute npm start
Additional Reference: https://reactjs.org/docs/create-a-new-react-app.html

"npm start" command suddenly stopped working with "create-react-app" project folders with both old and newly created projects

I've been using create-react-app to make some projects in react and also for practicing, and usually the way to run the project is to use the command npm start from the root directory of that project in the terminal. This has since stopped working for both my old projects which I haven't touched or completely new ones, and followed the exact instructions given by the error already to no effect.
An image of the error, the very top of the terminal is immediately after the npm start command:
I have been googling this over the past two days and I simply can't figure it out. I'm hoping someone with better knowledge would know the root of why npm start has stopped working. Please keep in mind that I already tried the suggestions provided by the error in the terminal.
What's really mind boggling is I haven't changed pcs or done any editing in the old projects such as the one in the picture above, re-installed a bunch of stuff I thought might have been causing issues like npm or babel but they simply don't launch anymore.
Also almost forgot the error log, which has been even more confusing to figure out or google:
You have problem with your dependencies. Please run
npm i
inside project directory.
As your console shows, you can try
remove your node_modules directory
delete file package-lock
I suggest clean npm cache (npm cache clean -f)
and reinstall node_modules using
npm i
There are many reasons to cause this problem.Some suggestions here:
1.uninstall babel-loader and create-react-app globally
npm uninstall -g babel-loader
npm install -g create-react-app
2.remove the error package
rm -rf ~/node_modules/babel-loader
3.stop all the command then clean up the cache of npm

Installing 2 year old application

I started a project 2 years ago that I now can't seem to install into other directories.
I used to follow these steps to install my angular frontend
npm install gulp
npm install typings
npm install
typings install
gulp build
I never had to do them again and it correctly installed a typings folder from which the gulp file found all it packages, it worked and I didn't mind how.
I am now trying to install it again and it does not fill the typings folder correctly, there only appears a index.d.ts file.
I found here https://github.com/typings/typings/tree/abea10b5787e1a18634d5f37bb2fa56550c32fd1
that it should've been around version 1.0.4.
So I try to install with:
npm install typings#1.0.4
But this still does not install any typing directory.
Any direction I should look into further would be apreciated.
If you look have a package.json file for the 2 year old project (which you should) then you should find the version numbers of each dependency in there.
Putting all my files in the package.json to the specified version an not just compatible with changed the error to Syntax error parsing, I was able to fix that with removing a translate application.

Error while installing Underscore typings

I am trying to install Underscore typings but getting error
Unable to find "underscore" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
I have tried different switches based on my research and solutions provided by others as you can see in image.
Please let me know if I am doing something wrong.
The core issue was a permission issue on my Mac. Your user account need to own your npm install directory.
Then you can run the command:
typings install dt~underscore --global --save
You should not see any more errors.
Below command is works for me,
typings install dt~underscore --global --save
Reference - GitHub Link
This is more recent as of April 2017
npm install --save #types/underscore

Resources