Not able to download dependency via yarn from GitHub NPM registry (npm.pkg.github.com) - github

I have started using GitHub NPM registry for one of the project which is a monorepo. I am using Lerna to manage it which uses yarn as package client.
I was able to publish the package to registry, and i am able to download the same via npm install command, but the same is not working with yarn add command. It throws the following error -
error https://npm.pkg.github.com/download/MY_USERNAME/MY_PACKAGE_NAME/PACKAGE_VERSION/HASH Integrity checked failed for "PACKAGE_NAME" (none of the specified algorithms are supported)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I have tried creating the lock file manually ( which isn't recommended ) but still no luck.

I just wanted to post the solution that worked for me:
yarn install --update-checksums

Related

flutterfire configure not working even after installing via npm, and relogging

I keep getting this error no matter what I attempt to do,
I've already tried using "npm install -g firebase-tools",
and "firebase projects:list" displays a correct list of my current projects.
Looking for help as I have sunk countless hours into this problem without being able to move a step forward.
FirebaseCommandException: An error occured on the
Firebase CLI when attempting to run a command.
COMMAND: firebase --version
ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be installed, see https://firebase.google.com/docs/cli#install_the_firebase_cli for how to install it. ```
In case you have installed (and renamed) firebase.exe from the windows installer, remove that first.
The installation of npm install -g firebase-tools and the windows installer are conflicting with each other.
Then go through firebase logout and firebase login again before running flutterfire configure.
I added the firebase-tools file downloaded from https://firebase.tools/bin/win/instant/latest in the root of the directory of my project and it works for me. I changed the name to firebase only.

Package not found in NPM through registry

I am totally new to devops, and I have a problem I don't know why it may be occurring.
We have our own registry with only two upstream sources:
source: npmjs
location: https://npmjs.org/
source: nuget.org
location: https://api.nuget.org/v3/index.json
Until now, I have had no problem installing packages. Then I tried to install sequelize-cli-typescript and the following error appeared:
400 Bad Request - GET https://pkgs.dev.azure.com/~azure-project~/npm/registry/sequelize-cli-typescript/-/sequelize-cli-typescript-3.2.0-c.tgz
I ran `npm set registry https://npmjs.org/' and tried to install the package again. It was installed successfully.
I understand that our registry should be using npmjs as a source, so every package available in npmjs should be available in our registry. What may be happening?
I am sorry if there is any setting I should have included. Again, I am new to devops. But let me know and I will add it.
Thank you!
EDIT
I am able to install random npm packages without problem. It seems to be only a problem with sequelize-cli-typescript.
I uninstalled sequelize-cli and then I was able to install sequelize-cli-typescript perfectly.

Should a vscode dev container run npm install as part of its setup?

I've created a VS Code dev container for my project. To help new contributors get started, should the dev container Dockerfile run npm install?
No. Dev container define a development environment and should not perform actions that would be part of a normal development workflow (such as running npm install).
There are a couple of reasons why npm install in particular should be avoided:
If you run npm install in the dev container Dockerfile and it fails, the dev container will fail to launch. It's farbetter if the developer can open the dev container successfully, and then run npm install in an environment where they can investigate potential failures
npm install must be re-run when the project's dependencies change. Running npm install as part of dev container setup hides this from developers.
Dev container should only use npm install to install global scripts or tools that do not belong in the project's package.json.
It is actually good practice to call npm install as part of the dev container configuration. It eases and accelerate setup of the development environment, ensuring it's ready to use out of the box without extra steps possibly missed.
Note that the npm install must be in a postCreateCommand where sources and package.json are available (contrary to the Dockerfile).
Due to the nature of docker and devcontainer, there is very little reason for the npm install command to fail and need debugging. If it ever happen, VSCode logs will provide meaningful information, otherwise the postCreateCommand can be disabled quickly to investigate the issue.
There exists an official VSCode video, so we can assume calling npm install as part of the dev setup is a common practice: How to automatically run npm install in a dev container.

Azure private build agent : No agent could be found with the following capabilities: npm, azureps

I am trying to use a local server as a build agent to build a project. The server already has
VS 2015,
VS 2017
Node 6,7,8 via NVM
NPM 4,5,6 via NVM
I can build the project locally via npm build or yarn build.
I have downloaded and configured and registered the private build agent already and I have it in the agent pool in the portal - xxx.visualstudio.com/xxx.
But when I try to schedule a build from the portal the following message is displayed :
No agent could be found with the following capabilities: npm, azureps
What do I need to fix so the build can run locally?
The problem was simple - I did not see where the Capabilities tab was. IMHO Requests and Capabilities are not easily discoverable. I saw it and I set the two variables to true and it started to work even though I did not know for sure if true is the right value.
Another problem was that NVM SYMLINK was not working as expected and the build agent could not find node.exe at all. It was not in the PATH at all. I uninstalled nvm and used only node 8.1.2 with npm 5 in order to make it run.
UPDATE
As of today you can add a 'node tool installer' task to your definition - this is the better solution that is available today as D.J. points out in the comment section.

Why does Yeoman generator not work when installed through npm?

Code
GitHub version: https://github.com/trevordmiller/generator-code-deck
npm version: https://www.npmjs.org/package/generator-code-deck
Background
I have built a Yeoman generator which is working perfectly locally (using npm link after cloning the repo from GitHub). However, when I npm publish the generator to npm and install it via npm install -g generator-code-deck, running the generator throws no such file or directory and cannot find module errors:
These errors don't make sense to me, because 1. the files and folders are obviously there (as shown by the screenshot doodles) and 2. the generator is working via a symbolic link to the local repo; why should the npm package be any different?
I have been searching online to find an answer but I can't find anything. Does anyone know why these errors are happening when trying to install via npm, but not via a symbolic link? Does anyone know how to fix this so that I can release the official npm version of the Yeoman generator? Any help would be much appreciated!
Chances are you're not publishing all files to npm.
This can be caused by a .npmignore file or by the files key of your package.json.