-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Can't publish using scoped private registry from parent directory #3993
Comments
Further to this, doing EDIT: This was a local auth token issue (my local token didn't have write permissions). Changing to the package directory before running publish actually works. So the issue is specifically when trying to publish a subdirectory of the current working directory. |
This happened to us as well and the following line got me curious |
I did a bit more digging and found the actual problem: NPM CLI uses console.log(npa('dist'));
/*
Output:
Result {
type: 'tag',
registry: true,
where: undefined,
raw: 'dist',
name: 'dist',
escapedName: 'dist',
scope: undefined,
rawSpec: '',
saveSpec: null,
fetchSpec: 'latest',
gitRange: undefined,
gitCommittish: undefined,
hosted: undefined
}
*/
console.log(npa('dist/admin'));
/*
Output:
Result {
type: 'git',
registry: undefined,
where: undefined,
raw: 'dist/admin',
name: undefined,
escapedName: undefined,
scope: undefined,
rawSpec: 'dist/admin',
saveSpec: 'github:dist/admin',
fetchSpec: null,
gitRange: undefined,
gitCommittish: null,
hosted: GitHost {
sshtemplate: [Function: sshtemplate],
sshurltemplate: [Function: sshurltemplate],
browsetemplate: [Function: browsetemplate],
browsefiletemplate: [Function: browsefiletemplate],
docstemplate: [Function: docstemplate],
httpstemplate: [Function: httpstemplate],
filetemplate: [Function: filetemplate],
shortcuttemplate: [Function: shortcuttemplate],
pathtemplate: [Function: pathtemplate],
bugstemplate: [Function: bugstemplate],
hashformat: [Function: formatHashFragment],
protocols: [ 'git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:' ],
domain: 'github.com',
treepath: 'tree',
gittemplate: [Function: gittemplate],
tarballtemplate: [Function: tarballtemplate],
extract: [Function: extract],
type: 'github',
user: 'dist',
auth: null,
project: 'admin',
committish: null,
default: 'shortcut',
opts: { noGitPlus: true, noCommittish: true }
}
}
*/ As you can see, using npa returns returns GIT SSH result when subpaths are passed to it. If you add a trailing "/" at the end of your path, it should fix the issue: console.log(npa('dist/admin/'));
/*
Result {
type: 'directory',
registry: undefined,
where: '[PATH_TO_REPO]',
raw: 'dist/admin/',
name: undefined,
escapedName: undefined,
scope: undefined,
rawSpec: 'dist/admin/',
saveSpec: 'file:dist\\admin',
fetchSpec: '[PATH_TO_REPO]\\dist\\admin',
gitRange: undefined,
gitCommittish: undefined,
hosted: undefined
}
*/ |
@GasimGasimzada Well found! Thanks. I'll see if we can test adding a trailing slash as an alternate workaround. |
This is a workaround for npm/cli#3993
This is a workaround for npm/cli#3993
This is a workaround for npm/cli#3993
Adding a trailing "/" at the end of the path solved it for us, thank you ! |
In case it helps, I suspect this issue might be a combination of:
|
... I mean, okay, but why... thanks anyways, a head scratching for a few hours |
NPM issue reference: npm/cli#3993
We ran into this as well; trailing slash fixed it. |
Yes, the shorthand of |
My script is cd'ing into the appropriate folder and running |
Thanks a lot @GasimGasimzada |
Workaround for an apparent bug with npm and Node version >14 (see npm/cli#3993 for full details).
…Node 18 upgrade from master branch (#1639) * EUI-6645 Restricted case acceess * EUI-6645 Restricted case acceess * EUI-6645 Restricted case access * update version * install * Add translation package * update version * Update package * yarn install * Update package * Merge from master * Merge from master * Merge from master * Merge from master * Merge from master * EUI-8816 Restricted Case Access - Feature toggle for deployment to Production * EUI-8816 Restricted Case Access - Feature toggle for deployment to Production * EUI-8816 Restricted Case Access - Feature toggle for deployment to Production * Update package version * version update after merge from base branch * EUI-8816 Restricted case access feature toggle functionality * Upgrade to Node-18 and NG-15 (#1550) * kick-off node 18 upgrade * use pay component at local * ng update @angular/core@12 @angular/cli@12 --force * ng update @angular/material@12 --force * ng update @angular/core@13 @angular/cli@13 --force * ng update @angular/material@13 --force * ng update @angular/core@14 @angular/cli@14 --force * cdk 14 * ts version * upgraes for fix * upgrade rpx-xui-translation * upgrade yargs-parser * upgrade cli to 15 * fix damn ng breakdown * ng update @angular/material@14 --force * ng update @angular/core@15 @angular/cli@15 --force * ng update @angular/material@15 --force * correct compilation errors after upgrades * ignore angular cache * set new major version * add yarn release file * comment out broken lint task * temporarily use ccpay-component from local * fix tests * fix tests * upgrade to media viewer pre-release * update version tag * delete local ccpay dist folder * use ccpay component prerelease * skip the tasks (to be fixed later on) * remove steps to unblock pre-release * use node 14 for release * Code tide * package json update * fix update package.json file and code tidy * fix update package.json file * fix update package.json file and code tidy * package.json file update * Using legacy angular material * package.json version update * fix: EXUI-787 - Fixed lint srcipt, lint issues, code issue. Code tidy * updated codebase * fix: EXUI-790 unit test now working; EXUI-996- Fixed dateTime Picker; Fix issue probate buttons - cancel and continue button * package.json updated * Update typography.scss * Version update * Update npmpublish.yml * update polling service inline with sonarcloud - Security Hotspot * code tidy * added updated fork version of rx-polling library * fix - EXUI-996 - fix issue with incorrect date formate * App version updated and code tidy * Update RELEASE-NOTES.md * version update * Update case-file-view-folder.component.ts * Vesion update * update test and karma config * Update karma.conf.js * Update case-file-view-folder-selector.component.spec.ts * ccpay-web-component version updated * version update * fix broken functional test and update toolkit version * version update * rpx-xui-translation version update - 1.0.1 * @olusegz07 rpx-xui-translation version update - 1.0.2 --------- Co-authored-by: olusegun odunukan <[email protected]> Co-authored-by: Olu <[email protected]> * fix yarn audit issue (#1634) * fix yarn audit issue * yarn audit fix yarn audit fix * Update RELEASE-NOTES.md * Fix/ex UI 1151 yarn audit version (#1637) * fix yarn audit issue * yarn audit fix yarn audit fix * Update RELEASE-NOTES.md * Version updated * EUI-9048: Re-release of Case Flags v2.1 incorporating Angular 15 and Node 18 upgrade from master branch Change to Node version 18 in GitHub npmpublish workflow, following upgrade of CCD Toolkit to Angular 15 and Node 18. * Add trailing slash to build location Workaround for an apparent bug with npm and Node version >14 (see npm/cli#3993 for full details). --------- Co-authored-by: John Benjamin <[email protected]> Co-authored-by: David Rajkumar Jayakumar <[email protected]> Co-authored-by: DavidJayakumar <[email protected]> Co-authored-by: John Benjamin <[email protected]> Co-authored-by: codaimaster <[email protected]> Co-authored-by: olusegun odunukan <[email protected]> Co-authored-by: Olu <[email protected]>
This is a workaround for npm/cli#3993
Is there an existing issue for this?
Current Behavior
After upgrading from Node v14 (and npm@6) to Node v16 (and npm@8), we're no longer able to use npm with a scoped private gitlab repository.
Note there are some issues which may be related to this, however the descriptions and error results differ enough that I felt it necessary to file this new issue.
Expected Behavior
Continue to function as before.
Steps To Reproduce
Build a package to dist/admin with the name containing a scope
"@vendorname/packagename"
and the"publishConfig"
key containing a"@vendorname:registry"
key. Set the appropriate npm config settings to allow publishing on node v14 and npm@6.Update to node v16 and npm@8, this no longer works giving the following error:
As stated, the private registry is on gitlab so I'm not sure why it's trying to contact github. When running
whoami
, the following error occurs:Environment
The text was updated successfully, but these errors were encountered: