Why aren't the Firebase Commands Working? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I aknowledge that this is a common issue, that has been discussed on stack overflow before. However, I have tried to implement the commands from other stack overflow questions and they have not worked.
These are the links I have used:
firebase-tools "-bash: firebase: command not found"
-bash: firebase: command not found
It appeared that I had successfully installed firebase. However all tools used leads to this:
command not found
I then implemented this:
alias firebase="`npm config get prefix`/bin/firebase"
Which did something strange to the terminal. But when I added commands to the new terminal, it still didn't work.
I also implemented the following:
npm get prefix
This returned:
/Users/andrewt/.npm-global
The rest of the guide then said:
And it should output something like /home/your-username/npm-global.
Then in your ~/.bashrc or ~/.bash_profile (if you're in a Mac) file, add:
export PATH="/home/your-username/npm-global/bin:$PATH" # Add npm bin PATH
Note the "/bin" after the npm get prefix result.
But I have no idea what that means, and my attempts to implement it failed.
If you are able to break down how to fix the issue so that I can understand - it would be greatly appreciated. Particularly if you can explain how it is working.

firebaser here
These days, Firebase also providers a standalone/prebuilt binary version of the Firebase tools that is much easier to get started with, and provides the exact same functionality as the NPM module.
If you're only just getting started developing with NPM, I'd recommend using the standalone binary of the Firebase tools for your platform. Find the documentation and link for Mac, Windows, and Linux in the documentation on installing the Firebase CLI.

Related

Changing default browser for npm live-server [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I am using npm live-server package to load my website on changes.
However my page is getting opened in Edge even though my system default is Chrome.
I tried this command which I saw in npm website.
live-server --browser=chrome
But it did not work.
How do I make it to host on chrome.
Some Operating Systems apparently use --browser=google-chrome or --browser='Google Chrome' instead of --browser=chrome.
Otherwise the issue may be with the Operating System not being able to locate the Chrome Browser. Try reinstalling Google Chrome on the specific user account with Administrator permissions, since this should add it to the PATH with the creation of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe.
Sources: How to change default browser with VS Code's "open with live server"?, 127.0.0.1 live-server in npm can't open in any browser. what is the problem here?.

How to run an old angular project? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
In my company there is an old angular (Not even sure what version) client that no one touched for at least 2 years and I got the "lucky" job of changing some feature in this client.
The confusing part starts when I noticed there are no package.json, package-lock.json and angular.json files in the project but the whole node modules directory and compiled js files are stored in the git repository.
The problem is that I have no idea of how to rebuild this project after I change the typescript files. In addition, I want to remove the node modules directory from the git repository and have package.json instead.
No one that originally worked on this project is still in the company (Not surprised after I seen this mess).
The backend is written in asp.net framework and contains .cshtml files so I suspect there is some relation between the client and the server
Can someone help me rescue this project?
Sounds like a bit of a nightmare! You can try these steps to start but I'm sure you will have issues. Persevere as I think you can do it! Once you get some errors to work from it will be easier. Good luck
Look in node_modules for #angular/ folder and find the angular
version (if there isn't one then its AngularJS).
Create a brand new project using angular-cli using the version you just found.
copy the contents of the app folder (at least) to the new project.
Search through imports to see which libraries are used and npm install them.

Using Require with React in a web page without node [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I know this might be a silly question to some of you, but I am beginner in React, and I wish to create a really simple application.
I found a sample in which every component is saved in a separate js file, which looks very good for modularity and re-usage.
The only thing I need to take care of now is using export/require. However, I don't need to be dependent on nodejs. I just need a simple html/js application that can run on any cheap web server.
I read somewhere that I can use "Browserify", but after looking at it, it seems like a node library.
Is there any library that I can use from a web page (via cdn for example) that allow me to use require? If not, does that mean I can not separate react components in different files?
However, I don't need to be dependent on nodejs.
Use NodeJS. It is how React applications are designed to be built.
I just need a simple html/js application that can run on any cheap web server
NodeJS is only required at build time. You run it on your development workstation. The output is static files that you can upload to any webserver.
(NB: React applications are often designed to make HTTP requests to get dynamic data. Some tutorials cover using Node to build a server to listen for and make responses to those requests. Make sure you don't conflate the program to transpile the React application to ES5 (which runs at build time) with the program to run a webserver (at runtime) even if both are written using Node).
If you don't want to use Node, you can use webpack: https://webpack.github.io/
you will generate a static/bundle.js . If you want to learn more about it, I sugest http://survivejs.com/
What you need is a build step that packs the separate files into one or more packages that can be loaded in the browser.
Browserify can be used to do that, but WebPack is also popular.
These tools require some configuration, so I think that the best way to start is with a tool like create-react-app which is easy to install and has commands for developing as well as packing your app for deployment.
It uses webpack internally (along with some other tools) but saves you the hassle of configuring it yourself. If at any time you need advanced configurations beyond what create-react-app provides, it has an 'eject' command that exposes the raw configuration files.
Getting started is simple (taken from their readme):
npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start

Do I need to install MonogDB on my PC in order to use it with NodeJS? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am in process of learning NodeJS and now diving into database stuff and want to learn MongoDB with Mongoose package.
I am having some difficulties with installing MongoDB on my PC since it is 32bit system and I become curious do I actually need to install it on my PC in order to use it?
Or can I just do "npm install mongodb" and use it within my sample project and then also install "mnogoose", or it is required to have MongoDB installed on my PC as well?
I would be very thankful if someone could help me and explain process a bit. :)
Yes, you'll need to install Mongo.
'npm install mongodb' only installs the mongo driver.
Mongodb from npm install is just, according to the official description:
"The official MongoDB driver for Node.js. Provides a high-level API on top of mongodb-core that is meant for end users."
https://www.npmjs.com/package/mongodb
So you will still need to install the MongoDB server in order to use it within your project. The mongodb package just allows you to access mongodb server from within node.

How do I get started with Hamlet.coffee? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'd like to be able to quickly and easily get up and running with Hamlet in node.js or the browser.
Where are some good resources for getting started?
From the README
Using Node.js
Install the command line Hamlet compiler
npm install hamlet-cli
Compile your templates and export them
node_modules/.bin/hamlet -d templates
Add hamlet-runtime to your package.json
npm install --save-dev hamlet-runtime
To use the templates in a Node.js style project built with browserify you can require them normally.
// main.js
mainTemplate = require("./templates/main");
document.body.appendChild(mainTemplate(data));
Now use browserify to build the file you'll serve on your page.
browserify main.js > build.js
Additional Resources
To get started I recommend the getting started section of the official readme
For general help or discussion you can talk on the Hamlet.Coffee google group
Specific questions about using Hamlet.coffee can be asked here on SO or on the google group.
Issues should be opened on the git repo https://github.com/dr-coffee-labs/hamlet/issues?state=open

Categories