问题-
在我现有的 Vue 项目中,如果我运行yarn installoryarn add package_name命令,则会发生以下错误 -
我读到的——
阅读本文后(向下滚动到“完整性哈希”部分),我能够对这个错误有了一些了解:
纱线将根据下载的内容计算每个依赖项安装的哈希值。下次下载该依赖项时,yarn 会再次生成哈希值。如果新值与yarn.lock中存储的值不匹配,yarn将抛出如下错误
Integrity check failed for <package-name> (computed integrity doesn't match our records, got <integrity-hash-value>:)
我相信我的错误是相关的。本文还建议的解决方案是阅读有关罪魁祸首的依赖项,如果可以安全使用,请重新安装它。我也读过这个GitHub 问题。
我的顾虑-
据我所知,一旦指定了已解析的版本,yarn.lock每当您运行yarn install. 在我的yarn.lock版本中yargs-parser是20.2.1.
我应该重新安装这个yargs-parser依赖项吗?如果是,那么如何?我有点担心重新安装对其他依赖项的影响。
我的环境详细信息-
以下包管理器在我的系统中全局安装 -
node- 14.19.0
yarn- 1.22.4
npm- 6.14.16
Run Code Online (Sandbox Code Playgroud)
如果需要,我可以提供更多详细信息。任何帮助都会很好。
我有一些项目,每个项目都有一个说明,show more末尾有一个链接。单击此链接时,我想触发一个功能。
但是,该方法正确触发并在控制台中打印结果,但更新不会在 Vue 模板中触发。
这是完整的代码:
<template>
<main>
<div class="card" v-for="(item, index) in items" :key="index">
<div class="content">
<h3 class="card-title">{{item.name}} </h3>
<p v-if="showMoreText[index]">{{ item.description }}</p>
<p v-else>{{ item.description.substring(0, 100) }}...<span class="link" @click="showMore(index)">show more</span></p>
</div>
</div>
</main>
</template>
<script>
export default {
data() {
return {
showMoreText: []
}
},
props: {
items: Array,
},
created() {
for (let i = 0; i < this.items.length; i++) {
this.showMoreText[i] = false;
}
},
methods: {
showMore(index) {
this.showMoreText[index] = !this.showMoreText[index]
// …Run Code Online (Sandbox Code Playgroud) 我已将 PHP 版本从 7.2 升级到 7.4,发现所有项目的调试都已停止。
我的配置是-
zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000
Run Code Online (Sandbox Code Playgroud)
我已在以下文件中添加了上述配置 -
php -v 命令返回以下输出-
PHP 7.4.14 (cli) (built: Jan 13 2021 08:04:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)
我也在 …
vue.js ×2
debugging ×1
installation ×1
javascript ×1
laravel ×1
node.js ×1
npm ×1
php ×1
php-7.4 ×1
yarnpkg ×1