All Questions
638
questions
1228
votes
24
answers
862k
views
How to install an npm package from GitHub directly
Trying to install modules from GitHub results in this error:
ENOENT error on package.json.
Easily reproduced using express:
npm install https://github.com/visionmedia/express throws error.
npm ...
299
votes
13
answers
360k
views
npm install private github repositories by dependency in package.json
I'm trying to install github private repository by npm that includes other private github repositories as dependency.
Have tried a lot of ways and posts but none is working. Here is what i'm doing :
...
296
votes
8
answers
201k
views
How to use private Github repo as npm dependency
How do I list a private Github repo as a "dependency" in package.json? I tried npm's Github URLs syntaxes like ryanve/example, but doing npm install in the package folder gives "could not install" ...
245
votes
4
answers
189k
views
How can I publish an npm package with distribution files?
I would like to publish a npm package that contains my source as well as distribution files. My GitHub repository contains src folder which contains JavaScript source files. The build process ...
190
votes
6
answers
97k
views
npm install and build of forked github repo
I'm using a module for my angular app called angular-translate. However, I've had to make a few small modifications to the source code to get everything working the way I'd like, and now I want to ...
104
votes
9
answers
62k
views
Proper way to fix potential security vulnerability in a dependency defined in package-lock.json
Github has given me this error on one of my repositories.
We found a potential security vulnerability in one of your dependencies.
A dependency defined in ./package-lock.json has known security ...
99
votes
4
answers
31k
views
Automatically Build NPM Module On Install From Github
Given that a project's lib/ dir shouldn't be checked into Git because the files it contains are derived files (from the build process). When installing a package from the project's github (during ...
87
votes
6
answers
43k
views
npm install package from github repo subfolder
Is it possible to install npm package from github when the package located inside subfolder?
For example, we have Microsoft BotBuilder repository:
https://github.com/Microsoft/BotBuilder
But I need ...
82
votes
8
answers
83k
views
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher
I am getting this warning from github on my npm project build process...
I tried searching on the internet and also read the blog link posted by github - but I could not find the solution to it ...
78
votes
6
answers
75k
views
Installing packages from github npm registry - auth error 401
I have just published a private package on GitHub, trying to figure out how it should be working. now I'm trying to install it in another project. I authenticated with npm login --registry=https://npm....
73
votes
2
answers
39k
views
npm install from github pull request
Loooking at the npm install docs it looks possible to npm install from a github repo.
Is it also possible to install specifically from a pull request?
Is the solution just to install based on the ...
65
votes
3
answers
22k
views
How to have npm install a typescript dependency from a GitHub url?
Consider the following scenario:
There is a code library. The library is written in TypeScript and the typescript code is published in GitHub. The package.json file has a build script which creates ...
44
votes
5
answers
55k
views
Github actions, 401 unauthorized when installing a Github Package with npm or yarn
When I try to install my npm modules from a GitHub action I get the following error:
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@xxxx%2fxxxx-analytics - Your request could not be ...
41
votes
5
answers
21k
views
Install an npm module from a private GitHub repository using GitHub Actions
I am trying to run a build for a Node.js project using GitHub Actions. As part of the npm install, I need to install an npm module directly from a private GitHub repository (not from GPR!).
In the ...
36
votes
4
answers
33k
views
Yarn can't find private Github npm registry
I signed up for the Github private npm registry beta and followed their instruction: https://github.com/features/package-registry
Works great with npm but I'd prefer using yarn. And while npm has no ...
35
votes
3
answers
8k
views
NPM: Missing dist and src directories when trying to install directly from a github url
An npm package I am using has been forked on github with some bug fixes and I now want to use the forked code in my project until the fork is merged.
In my package.json I change the reference in ...
29
votes
3
answers
16k
views
git is blocked, how to install npm modules
We are connected through a proxy and here, git is blocked ( not the website but on git//: ) we tried with egit, "git on windows", with and without proxy but not a single clone to local happened.
Now ...
29
votes
4
answers
40k
views
How to install PhantomJS v2 with npm
I'm trying to install PhantomJS v2.0.0 using npm and after trying a couple of methods I've not found a working solution...
On NPM the latest version is 1.9.16, so I've tried the following in my ...
29
votes
1
answer
8k
views
Can I exclude directories from GitHub Dependabot?
I have a directory /experiments in my repo which contains - surprise! - experiments. Those usually come with their own package.json which includes dependencies that were up to date at the time I made ...
29
votes
2
answers
8k
views
Exclude package-lock.json from GitHub contribution activity
Now that npm v5.0.0 is out, using npm packages auto-generates a package-lock.json on npm install. In my case, my package-lock.json file happens to be close to 10,000 lines of code.
Npm also suggests ...
26
votes
1
answer
14k
views
how to add link of my github repo to npm package?
I need to add an link of my github repository to my npm package. I did not find the solution yet on the npm documentation.
26
votes
4
answers
19k
views
npm install in GitHub Action fails with "ENOENT: no such file or directory" - Works fine elsewhere
I am currently working on replacing our Drone CI installation with GitHub Actions.
The Action Workflow I have so far boils down to the following .github/workflows/ci.yml file:
on: [ push, ...
25
votes
4
answers
38k
views
How to add a git repo in package.json file
I have an app where I didn't add its repository in package.json while doing npm init.
Now I want to add repo in the package.json file, but couldn't find helpful solutions for me.
Also, I found ...
25
votes
3
answers
4k
views
How to get rid of the ‘hoek’ vulnerabilities
I recently pushed an Angular CLI 5 application to GitHub and it indicated the following:
We found a potential security vulnerability in one of your dependencies.
A dependency defined in net-incident/...
24
votes
6
answers
6k
views
How to specify different readme files for github and npm
Both use the README.md as the description when you publish. A common practice is to use a single shared file.
But what if I need to have the different Readme and still publish it from a single local ...
19
votes
1
answer
15k
views
Caching npm dependency with github action
I want to cache npm dependencies so that I does not do npm install every time I push and instead just load it from cache.
I think github action support this now?: How do I cache steps in GitHub ...
19
votes
1
answer
418
views
What is the correct way with NPM to package a BUILT version of a forked Git repository?
I recently forked a GitHub repository to fix a problem, and created a pull request. While I wait for the pull request to be accepted, I have pointed my local package.json at my forked repo, like so:
...
19
votes
3
answers
6k
views
NPM install/dependency from a GitHub Release Binary
I know how to make an NPM dependency from a GitHub release :
"dependencies": {
"package-name": "user/repo#v1.0.0"
}
That's nice, but I want to install a specific binary from this release.
I tried ...
18
votes
1
answer
6k
views
npm install from git repo subfolder
I have a repo with various components and I want to be able to include the components as individual dependencies (but I don't want to create a repo per component).
Is it a way to use a subfolder of a ...
17
votes
4
answers
37k
views
Suitable `.gitignore` For Node.js
Tree structure
That's how my Node.js project is organized:
/
| - node_modules [+ INCLUDE]
| | - my-mod1
| | | - node_modules [- IGNORE]
| | | | - external-mod1
| | ...
16
votes
2
answers
4k
views
Trying to deploy my React app with gh-pages but got this error message : The "file" argument must be of type string. Received type undefined
I was trying to deploy my React app with gh-pages but I'm facing this error : The "file" argument must be of type string. Received type undefined.
At first, I thought it was my code so I've made ...
15
votes
8
answers
20k
views
npm ERR! premature close when using npm install
Getting [..................] / rollbackFailedOptional: verb npm-session 5d754927a47910d2 on installing from github.
Tried multiple things like cleaning cache, resetting proxy, etc but none of them ...
15
votes
2
answers
10k
views
How to support multiple private npm packages living in one git repo?
npm is very good at supporting packages publishes to the global/central npm repo, which doesn't work well for private, application code. npm also supports adding a git repo as a dependency, which ...
14
votes
1
answer
11k
views
Github's action is not building react application
When I build (npm run build
"scripts": {
"build": "react-scripts build --passWithNoTests"
})
project on pc, it successfully builds.
But when I push changes, the building ...
14
votes
3
answers
18k
views
NPM install from github using a tag
I need to do a npm install into my angular2 project from git but using a tag which is tag = 6.0.0.
e.g.
git [email protected]:akveo/ng2-smart-table.git
cd ng2-smart-table
git checkout tags/v0.6.0-0
...
13
votes
2
answers
13k
views
Is it possible to change npm user? [closed]
Editing profile is easy and intuitive but there seem to be username change feature missing. I am trying to find a way to change my npm username from npmjs.com.
The only thing I come up with so far is ...
13
votes
8
answers
48k
views
Cannot install with npm package from git
I am trying to install package from git, which I forked earlier.
I try
npm i catsaredoomed/invest-openapi-js-sdk --save-dev
I've got
npm ERR! prepareGitDep 2> npm WARN install Usage of the `--dev` ...
12
votes
4
answers
8k
views
Cannot install npm package in Github registry
I have published a package to the GitHub npm registry. I can see the package when I login onto GitHub, as per the screenshots below.
ScreenShot 1
ScreenShot 2
Locally, a different package has the ...
12
votes
3
answers
25k
views
'Could not read from remote repository' on NPM install from GitHub public repo
I have problems installing some NPM packages. This happens when NPM package (angular2-materialize for example) is installed from the repo:
npm i InfomediaLtd/angular2-materialize
Also happens with ...
11
votes
2
answers
4k
views
Travis failed push but passed PR
How is it possible that Travis the build failed for the latest push but passed the Pull Request?
On this Gist, you could find the failed and passed output log of the npm run build command that Travis ...
11
votes
1
answer
4k
views
How to use Github Pages with Dependencies?
Sorry if this is more of a general question.
I set up a github pages account under: username.github.io
This allows me to access my applications on: username.github.io/repository-name
Now I am ...
10
votes
5
answers
12k
views
Lerna always lists all packages ready to publish when running workflow of Github actions
Lerna does not correctly detect packages change during running workflow of Github actions.
If I make none packages related changes, commit and runlerna updatedlocally. it tells me No changed packages ...
10
votes
1
answer
797
views
Badge for bower dependencies on github
On github it is possible to show a badge about the status of your npm dependencies ( https://david-dm.org/ )
I was wondering if there is something like this for bower dependencies ?
10
votes
4
answers
2k
views
npm install from GitHub in specific environment
My team uses a private npm registry. We install packages from this private registry when developing locally and when deploying to production. When deploying to staging, however, we'd like to pull from ...
10
votes
2
answers
8k
views
How to use node_modules on Github Pages, without uploading to repo
I'm hosting a site on Github pages, and using Jekyll to generate it.
I added Angular and Lodash to my project using npm, but didn't want to upload 200 odd files to GitHub so I added node_modules to ...
9
votes
1
answer
12k
views
Github Actions - Reached heap limit Allocation failed
Github Action gives my this error for the last "run: npm run build"
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Error: Process completed with exit code ...
9
votes
1
answer
6k
views
How to update npm package from a local folder
I cloned some npm package from github and put the package in a local folder, e.g.
c:\git\package
I used "npm install -g" to install the package, which works really well.
npm install -g c:\git\...
9
votes
2
answers
6k
views
How to specify npm dependency as github subfolder url?
My git repository:
README.md
packages
common
package.json
main
package.json
How to specify common dependency in main package.json as github subfolder url?
This does not work "common": "...
9
votes
1
answer
22k
views
Error while installing packages using yarn or npm, `Request failed \"401 Unauthorized` [closed]
I'm facing an issue while trying to download a package from the GitHub NPM Registry. Whenever I attempt to install the package using the npm registry URL (https://npm.pkg.github.com/download/[PACKAGE])...
8
votes
9
answers
17k
views
cannot install node-sass therefore cannot install gulp-sass
I'm trying to set up an environment in which I could use a sass compiler with gulp, part of my environment is set up by installing gulp-sass, however, I get an error. After some research, it is ...