abp icon indicating copy to clipboard operation
abp copied to clipboard

abp install-libs specify mirror

Open LeiYangGH opened this issue 1 year ago • 10 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

when running abp install-libs i got error

Running Yarn on C:\G\lyabp\LyAbp\src\LyAbp.Web ➤ YN0000: ┌ Resolution step ➤ YN0001: │ RequestError: read ECONNRESET at ClientRequest. (C:\Users\yang.lei.yarn\releases\yarn-3.6.1.cjs:195:14340) at Object.onceWrapper (node:events:628:26) at ClientRequest.emit (node:events:525:35) at ClientRequest.o.emit (C:\Users\yang.lei.yarn\releases\yarn-3.6.1.cjs:190:90286) at TLSSocket.socketErrorListener (node:_http_client:494:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)

Describe the solution you'd like

i cannot access the default registry/github/google, or too slow. so want to use some mirror, such as https://registry.npmmirror.com

Additional context

No response

LeiYangGH avatar Jan 30 '24 08:01 LeiYangGH

or could you tell me the way to install libs using pure npm? or enhance document to set some npm mirrors. thanks!

LeiYangGH avatar Jan 30 '24 08:01 LeiYangGH

hi

CLI will call yarn command to restore packages first.

You can try to run yarn manually, and then CLI will copy the js/css to the libs folder.

maliming avatar Jan 31 '24 01:01 maliming

yarn.log hi thanks!

i used yarn to install in Abp.Web folder, but nothing installed in Abp.Web\wwwroot\libs. instead, i see a lot of new files under Abp.Web.yarn my console logs attached. could you help point out what's wrong?

LeiYangGH avatar Jan 31 '24 07:01 LeiYangGH

yarn --version 3.6.1

Abp need Yarn v1.20+ , Yarn v2 works differently and is not supported.

maliming avatar Jan 31 '24 08:01 maliming

could you help me check why i cannot downgrade yarn?

PS C:\G\lyabp\LyAbp\src\LyAbp.Web> npm uninstall yarn -g

removed 1 package, and audited 2 packages in 257ms

found 0 vulnerabilities
PS C:\G\lyabp\LyAbp\src\LyAbp.Web> yarn -v
yarn : The term 'yarn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ yarn -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (yarn:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\G\lyabp\LyAbp\src\LyAbp.Web> npm install -g [email protected]

added 1 package in 2s
PS C:\G\lyabp\LyAbp\src\LyAbp.Web> yarn -v
3.6.1
PS C:\G\lyabp\LyAbp\src\LyAbp.Web>

LeiYangGH avatar Jan 31 '24 08:01 LeiYangGH

I don't know much about node and yarm. You can try to uninstall the node and reinstall it completely.

npm list -g

maliming avatar Jan 31 '24 08:01 maliming

yarn install only install node_modules, there must something else that abp install-libs does that finally built and copied files into wwwroot/libs folder. do you know the steps?

LeiYangGH avatar Jan 31 '24 13:01 LeiYangGH

hi

https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs

maliming avatar Feb 01 '24 01:02 maliming

why not add some document in abp official site? i think this is often asked? and above csharp code checks npm, yarn, etc, and it should also check yarn version, right? since you said only 1.x is supported. but currently in 2024 yarn 1.x is not mainstream.

LeiYangGH avatar Feb 02 '24 08:02 LeiYangGH