The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Thank you for reaching out to Microsoft Q&A
Based on my research, the npm error code E404 occurring with the URL https://microsoftit.pkgs.visualstudio.com/_packaging/Finance/npm/registry/%20always-auth=true/@microsoft%2fgenerator-sharepoint is caused by npm attempting to resolve the @microsoft/generator-sharepoint package from a private Azure Artifacts registry rather than from the public npm registry (https://registry.npmjs.org/).
Moreover, the presence of %20always-auth=true (a URL‑encoded space followed by always-auth=true) within the registry URL clearly indicates a malformed or incorrectly formatted .npmrc configuration file. This typically happens when multiple configuration settings are mistakenly placed on the same line (for example, registry=... always-auth=true instead of being on separate lines), or when remnants of a corporate or enterprise npm setup remain on a machine after leaving that environment.
Given this, you can try the below approaches to see if it can help you:
1. Review and correct your .npmrc configuration
Kindly check both global and local npm configuration files:
- Windows:
%USERPROFILE%\.npmrc - macOS / Linux:
~/.npmrc - Also verify whether a
.npmrcfile exists in your project directory.
Look for entries such as:
-
@microsoft:registry=... -
registry=https://microsoftit.pkgs.visualstudio.com/... -
always-auth=true
If you are not intentionally using a private or corporate npm feed, the recommended action is to remove or comment out all custom registry configurations that override the default registry or apply specifically to the @microsoft scope
2. Reset the npm registry configuration
You can quickly restore npm to a clean public configuration by running the following commands (run one-by-one):
npm config delete @microsoft:registry
npm config delete registry
npm config set registry https://registry.npmjs.org/
Then you have to clear cache after changing registry to avoid npm using stale registry metadata.
npm cache clean --force
3. Retry the installation
Once the configuration is corrected, rerun your original command:
npm install -g @rushstack/heft yo @microsoft/generator-sharepoint
You can read here for more insight:
https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment
https://docs.npmjs.com/cli/v10/configuring-npm/npmrc
https://docs.npmjs.com/cli/v10/using-npm/config#using-a-different-registry-for-a-specific-scope
Note: This information is provided as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the above link.
You can try the above approach, if the problem still persists, kindly let me know in the comments for further support
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.