【hexo博客问题】

windows下使用gitbash即可使用

其他bash会产生权限问题

npm install失败

bash 复制代码
$ npm install
npm error code ENOENT
npm error syscall open
npm error path F:\pf_project\blog_pf\package.json
npm error errno -4058
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory,
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: 

解决方法

进如正确的blog项目文件夹目录执行即可,就会生成package.json文件

npm淘宝镜像cnpm安装使用(最新版)

直接替换软件源

在开发 react-native 的时候,不要使用 cnpm,cnpm 安装的模块路径比较奇怪,package 不能正常识别。所以,为了方便开发,我们最好是直接永久使用淘宝的镜像源.

  • 直接命令行的设置

    bash 复制代码
    npm config set registry http://registry.npmmirror.com
  • 手动修改设置

    打开.npmrc文件(C:\Program Files\nodejs\node_modules\npm\npmrc,没有的话可以使用git命令行建一个( touch .npmrc),用cmd命令建会报错)

    增加 registry=http://registry.npmmirror.com 即可。

  • 如果需要恢复成原来的官方地址只需要执行如下命令:

    bash 复制代码
    npm config set registry https://registry.npmjs.org
  • 检测是否安装成功:

    bash 复制代码
     npm config get registry
相关推荐
bigHead-7 小时前
Git合并操作详解:安全高效地合并远程分支
git·安全·elasticsearch
C_心欲无痕7 小时前
ts - 交叉类型
前端·git·typescript
秋饼9 小时前
【K8S测试程序--git地址】
git·容器·kubernetes
小龙21 小时前
【Git 报错解决】本地无有效提交无法推送(`src refspec main does not match any`)
git·github·报错
小扶苏21 小时前
删除git全局账号信息并设置成新的账号密码命令
git
Greg_Zhong1 天前
Git创建任务分支进行开发,最后合并主分支master【纯git命令执行过程】阐述
git
眯眼因为很困啦1 天前
GitHub Fork 协作完整流程
前端·git·前端工程化
AlexDeng1 天前
Git 中模糊搜索分支名称并创建本地跟踪分支
git
jxm_csdn1 天前
递归工程工厂:Claude Code + Git Worktrees + Tilix/Tmux 的“AI分身”编码团队
人工智能·git
码咔吧咔1 天前
Git 中 pull.rebase = true 的作用与设置方法详解
git