Skip to content
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

提个小建议:版本锁定在package中 #11

Closed
Lingtin opened this issue Oct 25, 2023 · 7 comments
Closed

提个小建议:版本锁定在package中 #11

Lingtin opened this issue Oct 25, 2023 · 7 comments

Comments

@Lingtin
Copy link

Lingtin commented Oct 25, 2023

image image

大佬提个建议,能不能使用volta的方式,把版本锁定在package中

@1111mp
Copy link
Owner

1111mp commented Oct 25, 2023

其实无论是保存在package.json还是.nvmdrc中都是有利有弊的,之所以没有放在package.json中是因为考虑了有些项目其实没有用到该文件(比如一些单纯的js脚本,或者其他语言需要用到了js脚本...等需要指定node版本),然后还有项目涉及多人合作的时候可以直接通过在.gitignore中可以直接忽略.nvmdrc文件,不会有其他副作用,最后就是想尽量减少对其它的依赖......

所以最终就是选择放在.nvmdrc文件中了。望理解。

@Lingtin
Copy link
Author

Lingtin commented Oct 25, 2023

image 使用npm i -g yarn,安装的yarn或者是nrm在终端执行都找到,查看了~/.nvmd目录中对于的版本确实是有yarn这个包下载的,就是命令找不到,这个怎么解决啊

@Lingtin
Copy link
Author

Lingtin commented Oct 25, 2023

image image 这是我的目录,已知是有包的,但是没有映射

@1111mp
Copy link
Owner

1111mp commented Oct 25, 2023

我想我应该知道是什么问题了,你试试使用npm install -g yarn 命令重新安装试试呢 使用install全称安装 我好像没有考虑到缩写形式
如果还是有问题的话试试前面加上sudo 或者提供一下nvm-desktop的版本 以及执行一下 nvmd -h 命令查看命令行工具是否正常

抱歉

@Lingtin
Copy link
Author

Lingtin commented Oct 25, 2023

image

重新使用npm install -g xxx 命令安装,是可以有记录的。这边就是应该是缩写的问题了。

@1111mp
Copy link
Owner

1111mp commented Oct 25, 2023

谢谢你的反馈,问题我已经记录下来了,下个小版本会修复这个问题。

感谢。

@1111mp
Copy link
Owner

1111mp commented Nov 2, 2023

已经在Release v2.4.0中修复。

如果有问题请随时打开此问题。

@1111mp 1111mp closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants