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?.
Related
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 6 days ago.
Improve this question
The site works 1 out of 5 times after reloading it.
I'm getting these errors in console.
Console errors
I added base tag in my public/index.html file with url to this exact web app, and also added publicPath: "/" to vue.config.js.
To deploy I used dokku with buildpacks herokku-buildpack-nodejs, buildpack-nginx. NGINX_ROOT is set to dist. Server is running Ubuntu 20.04.
Dev build is working fine on localhost.
I tried to re-deploy app a few times, configured nginx for vue-router.
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.
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 3 years ago.
Improve this question
I'm trying to run two scripts concurrently, and I found this package concurrently that supposedly would help me. I did npm install concurrently --save and it's listed in my package.json. When I go to run it, however, it throws:
concurrently: command not found
I don't understand why it can't find it despite being installed. I've set up the commands as shown here, so I know it can't be that. I've checked earlier instances of this issue, but it appears to be outdated. Is there another way I can check if this works, or should I try something else?
Screenshot:
When you install using npm install without specifying the global flag -g, you are installing the module to your projects node_modules folder. If that module has any runnable binaries, they will be added to node_modules/.bin - so you should be able to run your local version of concurrently by running node_modules/.bin/concurrently (or from any folder in your project $(npm bin)/concurrently). I personally prefer using the project's local dependencies over installing global ones so I have the option to use a different version in another project.
If you put a script into the package.json "scripts" field it will reference these locally installed without having to specify the full path because npm run adds your projects node_modules/.bin to your path.
If you're having issues, I would start by checking the node_modules/.bin folder and verifying that the binary for your script actually exists.
This issue also comes up when there is a dash "-" in your folder name. i.e. (/developer/api-movies) or even (/developer-apps/apiMovies. Use camelCase throughOut rather than dashes.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm developping a web page using Vue.js, without backend (for the moment).
I need tabs, so 've looked at vue-tabs-component.
But to install it I need to :
npm install vue-tabs-component --save
How will this library be served to users ? They won't have npm installed nor npm install vue vue-tabs-components while navigating.
I'm developping only the frontend, therefore I don't need npm and I developp from several computers, several haven't npm.
Is there a way to use library only with <script src=...> ?
I took vue-tabs-component as example but my question is a general one: why have I to install frontend if it's gonna be served to client without them installing it ?
The word 'install' might cause some confusion for you here. npm install some-front-end-library downloads the files of our imaginary some-front-end-library package (e.g. a vue component).
After 'installing' (downloading the package), you reference to these files in your Vue project. E.g.
import somefrontendlibrary from 'some-front-end-library'
Vue.use(somefrontendlibrary);
You need to download/install the package first on the computer you're developing on, in order to be able to import them in your project. Just like you would download any other third party script which you later add using a script-tag.
When you build your project (npm run build), a vendor.js file will be generated (among others) which includes the some-front-end-library package. This file includes the package which you've installed (and added through Vue.use()).
Your final build (npm run build) will have an index.html file with a <script src="vendor.js" /> tag.
You need to install the module in order to use it. If, for example, you needed vue-tabs-components somewhere in your web app, you are going to need that source code for that module in order to use the tabs.
When it's served to the client, the code gets packaged and bundled so it's true, they don't need npm, but you do as the developer.
And regardless of if you are front-end or not, if you are using Javascript, you're more likely than not going to need NPM at one point in the development process.
If you want to use CDN's, you could check https://cdnjs.com/
There are CDN's of some NPM front end libraries, but it's not always assured you'll find what you're looking for.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have developed a nodejs application for a client, but obviously asking a client to install nodejs and npms in their system does not look good.
NPM's does not work if we simply copy paste them, we require to do npm install 'npm name', which is also an issue.
Assuming that client does not have internet access in their system,
I want a single exe or some file which on click can work without any need to install any npms or nodejs.
Is there something which can make it happen? I am sure there must be, which I am missing. I will be grateful if someone can help me in this
Thanks in advance
UPDATE
I am not getting option to answer my question so updating the question itself
How to install NodeJS project locally without internet connection?
this was really helpful.. that is how I can zip my modules and install it at some other machine .. and
https://github.com/jxcore/jxcore
this can be useful to run project as a single file
Kinda hacky, but you could run an electron (atom-shell) instance without showing the browser window and use the main process as a Node.js playground.
For any references about building and deploying Electron
The professional way to do this is to build a locally-installable package for your client's appropriate package management system.
All major Unix-derived operating systems (and even Windows, sortof) ship with a robust package management system which was designed with this sort of scenario in mind.
Fedora / Redhat / CentOS - Building an RPM package
Ubuntu / Debian / Windows (Windows Subsystem for Linux) - Building a DPKG
Mac OSX - pkgbuild
FreeBSD / OpenBSD - This is a bit trickier to do for a package like Node.JS for a number of reasons, but there are plenty of resources online.
If you or your clients can't provide the Windows Subsystem for Linux, there are perhaps dozens of projects from nexe to the Closure compiler for building a Node project as a single executable for a diverse set of platforms.
If you've got the itching feeling that you have too much free time, V8 also includes tooling for targeting code emitted from CrankShaft for arbitrary instruction sets with the d8 debugger. I've heard stories of sufficiently "sophisticated" (read: unhinged) programmers wrapping this in a PE/COFF for Windows à la SBCL Common Lisp 'core dumps'.
SSH into their system and install it. Not hard at all. Depending on their operating system would determine the steps needed to be taken. That's the only proper way to do it. I do it for clients on the daily.