Cannot access npm package stored in azure artifact via npm install - npm

I have a private package which are types produced by a backend C# application. Those types are pushed to a sharedTypes directory and published to Azure via npm publish configuration as shown in this tutorial.
Everything works great, until I try to actually install the package. The only errors I get back seem to be a e404 not found, even though I've placed a .npmrc file at my $home directory as well as inside of the project that I am trying to inject it into. Followed the directions by copying the credentials into the .npmrc file as shown inside of Azure.
Are there additional settings I need to set to be able to npm install if from my development machine? Not sure exactly what I am missing.

Related

How to view your in production VueJS project locally before publish changes

I have VueJS project published on Netlify, what i want to do is to make modifications to this project and see my changes locally before i update the repo on GitHub and publish the changes on Netlify. So simply i'm trying to find a way to serve the project locally but this doesn't work anymore after the project got published on Netlify.
Whenever i run npm run serve i get the below error:
PS F:\Projects\reaction-timer-testing> npm run serve
> reaction-timer-testing#0.1.0 serve
> vue-cli-service serve
'vue-cli-service' is not recognized as an internal or external command,
operable program or batch file.
I assume this is because that project is in build mode and i did that by running npm run build while i was publishing it to Netlify.
I've read someone recommends to run serve -s dist and this got me no where because each time i visit the local link http://localhost:3000 it gets 404: the requested path could not be found.
Another one advised to download and install xampp but i don't know what to do next i think i've tried everything.
Here is a view of my project files (it's a very simple project that i made for learning)
Pic of project files
Link to the project on Netlify: https://reaction-timer-testing.netlify.app/

How to publish zip file using npm publish?

I am currently publishing my project to an artifactory registry as a .tgz file. I am working on implementing a CD step that will pull the file from artifactory and put it into an in-house application.
Unfortunately the application only accepts zip files. Is there a way I can specify the format of the file that npm publish puts my application in before sending it to my artifactory registry? I don't see any options for this in the documentation, but it seems like it should be possible unless I'm missing something.

Azure DevOps Artifacts not including all packages?

I have a feed configured in Azure DevOps, with an upstream feed of https://registry.npmjs.org.
When I run yarn from my terminal, all of the packages in my package.json and their dependencies are correctly downloaded to my machine, but only a subset are added to my feed (59 packages listed in the feed vs. 1029 in my node_modules folder). There are 17 packages explicitly listed in my package.json.
I need to have all of the packages/dependencies stored in the DevOps feed so that we can restrict allowable packages and versions. We want to prevent regular developers from adding new packages or changing package versions on a project - letting them just pick from the "approved" packages/versions (which we do by requiring them to use a different feed which is configured with only our "restricted" feed as its upstream source). If there's another way to do this, that's fine.
Once you consume a package from an upstream source once, a copy of it is always saved in your feed.
This may be caused by the cache, If the package is already cached locally. It will not download again and save the package in your feed.
Please run the command npm cache verify, you can see the package path along with other details. Clean the package cache and try it again, it should save all packages downloaded from the upstream feed.
In addition, please also try to run the project via hosted agent. With Microsoft-hosted agents, each time you run a pipeline, you get a fresh virtual machine.
I hope it can help you.

Is there a way in Verdaccio to generate package.json files based on what it has in it's storage?

I'm publishing angular packages to Verdaccio to use inside the company. Suddenly, I found out that one of my package is missing, when I run npm install it gives me an error saying Can not find that specific module. When I checked the verdaccio UI it was not there as well then I checked the server where Verdaccio is hosted, there was no package json file inside that package folder but all the .tgz files are there.
all the tgz files
Is there a way to redo all of it's package.json files based on what it has in it's storage?
Verdaccio version -4.0.4

npm/bower - Basic questions(Why it requires for just AngularJS then?)

I read about npm and bower, differences, usage, how it works, purpose as well. All explanation says that to work in NodeJs. But when I searched for AngularJS2, the tutorial says use npm. I have some basic questions based upon the understanding that npm basically for dependency management or packages to be installed.
How my Java/Eclipse workspace knows that npm installed the particular JS library/file, what path should be given in the html/web page for including those files/libraries?
If I move the web application to production, how will the server gets those dependent libraries? Even if server gets it, it might be installed in different folder. Basically how it can be managed with a web applications in different environments for just AngularJS app?
Can anyone please help me to have better understanding?
Finally found the answer. NPM is node package manager which helps basically to download the dependencies (almost like maven, gradle in java).
npm software needs to be installed in developer's machine.
Add the required dependencies in the package.json in the root folder of AngularJS application.
Open the DOS command line and navigate to project root folder(workspace/project in eclipse), then type npm install which will download all the dependencies mentioned in the package.json to a folder called npm_modules inside project folder.
The other and important advantage is npm can be used to install browser agent as well. So npm start command will open the browser and will load the application automatically in browser. Developer does not need to be aware about NodeJs. One more benefit of using this approach is the browser will get refreshed automatically when any update in the JS file gets saved.