美文网首页
初次使用lodash的笔记

初次使用lodash的笔记

作者: sylviashan | 来源:发表于2018-12-07 15:46 被阅读33次

安装

cnpm i lodash -S 

引用


引用代码

import _ from 'lodash';

Vue.prototype._ = _;

使用


使用


打印

出现的报错:

    1.

报错一

PS C:\Users\EDZ\Desktop\vue_sly\exercise\slytestpro> npm i lodash -S

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ lodash@4.17.11

updated 1 package and audited 30458 packages in 10.514s

found 8 vulnerabilities (1 low, 1 moderate, 5 high, 1 critical)

  run `npm audit fix` to fix them, or `npm audit` for details

这个出现的原因我百度了下  大概的意思是可以忽略它。但是你真的运行不起来lodash啊!而且就是装不进去呀!!!  于是  我运行了它建议的npm audit fix   发现... 没卵用!真的!相信我!

这个问题 可以参考这个blog哦~    https://cloud.tencent.com/developer/ask/150215

2.

报错二

× Install fail! Error: EPERM: operation not permitted, symlink 'C:\Users\EDZ\Desktop\vue_sly\exercise\slytestpro\node_modules\_lodash@4.17.11@lodash' -> 'C:\Users\EDZ\Desktop\vue_sly\exercise\slytestpro\node_modules\lodash'

Error: EPERM: operation not permitted, symlink 'C:\Users\EDZ\Desktop\vue_sly\exercise\slytestpro\node_modules\_lodash@4.17.11@lodash' -> 'C:\Users\EDZ\Desktop\vue_sly\exercise\slytestpro\node_modules\lodash'

npminstall version: 3.16.0

npminstall args: C:\Program Files\nodejs\node.exe C:\Users\EDZ\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\EDZ\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://registry.npm.taobao.org lodash -s

因为报错一不死心的我转而去试了试cnpm i lodash -s 燃鹅 也报了错。

经过实验我们还是用git bash 吧!

相关文章

  • 初次使用lodash的笔记

    安装 cnpm i lodash -S 引用 import _ from 'lodash';Vue.prototy...

  • lodash 常用

    uniapp使用lodash 安装lodash: npm i lodash -S

  • 仅执行一次函数

    仅执行一次函数的话,使用类似 Lodash 库的 _.once(func)[https://lodash.com/...

  • lodash笔记

    _.forEach 当需要在forEach里使用continue时,采用return 或者 return true...

  • Git版本控制

    《GitHub入门与实践》笔记推荐Git练习网站:LearnGitBranching 初次使用时,使用下列命令设置...

  • 印象笔记的初次使用

    最近放弃了为知笔记,“投奔”印象笔记。因为最吸引我的是强大的搜素能力。于是花了点时间建立笔记本: 今后,有用的资料...

  • minimize lodash bundling

    lodash 是一个经常使用的数据处理工具库。它使用起来很便利,但是也有个小问题,就是lodash本身挺大的(未压...

  • Lodash 内容分组处理

    对这样的数据 分组成 使用 Lodash 可以这样操作

  • vue使用lodash

    一、安装 二、方法一 1、引入 2、使用 二、方法二 1、引入 2、使用 三、vue单文件组件中使用 里面分别有我...

  • Lodash使用入门

    项目里用到了Lodash。感觉有些还是很好用。就自己开研究了下。 参考链接: Lodash 中文文档 Lodash...

网友评论

      本文标题:初次使用lodash的笔记

      本文链接:https://www.haomeiwen.com/subject/gguthqtx.html