qmhc / grid-layout-plus

A draggable and resizable grid layout, for Vue 3.
https://grid-layout-plus.netlify.app/
MIT License
325 stars 40 forks source link

npx only allow pnpm #9

Closed lukasnemec1604 closed 1 year ago

lukasnemec1604 commented 1 year ago

why would you make it only run pnpm or yarn but withoout allowing to install plugin with npm?

qmhc commented 1 year ago

If you install and use it, it won't restrict your project's package manager.

For this project, to maintain consistency with the lock file, and it's using pnpm workspace.

lukasnemec1604 commented 1 year ago

thanks for the explanation.

alexlyul commented 1 year ago

Unfortunately, this setting breaks installation, at least when you have a custom package registry configured inside your project via the .npmrc file.

npm ERR! code 1 npm ERR! path ....\node_modules\grid-layout-plus npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npx only-allow pnpm npm ERR! npm ERR! code E401 npm ERR! npm ERR! Unable to authenticate, your authentication token seems to be invalid. npm ERR! npm ERR! To correct this please trying logging in again with: npm ERR! npm ERR! npm login npm ERR!

Authentification itself works though, it is possible to add other packages

qmhc commented 1 year ago

@alexlyul Would you provide a reproduction?

In my local machine (Windows), it works well with npm@8.19.2 (with custom registry in .npmrc).

alexlyul commented 1 year ago

Hello @qmhc! I have tried to reproduce it in a new blank project.

We are using the AWS code artifact as a private package registry.

Node and npm, (on windows 11)

$ node -v && npm -v
v18.13.0
8.19.2

package.json file:

{
  "name": "grid-layout-plus-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "grid-layout-plus": "^1.0.2"
  }
}

Running npm i:

$ npm i
npm ERR! code 1
npm ERR! path C:\Projects\grid-layout-plus-test\node_modules\grid-layout-plus
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npx only-allow pnpm
npm ERR! npm ERR! code E401
npm ERR! npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! npm ERR! To correct this please trying logging in again with:
npm ERR! npm ERR!     npm login
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     C:\Users\alexr\AppData\Local\npm-cache\_logs\2023-08-18T18_21_15_999Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\alexr\AppData\Local\npm-cache\_logs\2023-08-18T18_21_12_226Z-debug-0.log

Running npm i grid-layout-plus -S:

npm i grid-layout-plus -S
npm ERR! code 1
npm ERR! path C:\Projects\grid-layout-plus-test\node_modules\grid-layout-plus
npm ERR! command failed

npm
npm ERR!     C:\Users\alexr\AppData\Local\npm-cache\_logs\2023-08-18T18_16_39_859Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\alexr\AppData\Local\npm-cache\_logs\2023-08-18T18_16_39_859Z-debug-0.log

I have also tried publishing your package without the npx only-allow pnpm line and it works then