【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
相关推荐
xiAo_Ju6 小时前
git hooks配置
git
mit6.8248 小时前
[Git] 如何拉取 GitHub 仓库的特定子目录
git·github
许心月9 小时前
Git#revert
git
军军36013 小时前
Git大型仓库的局部开发:分步克隆 + 指定目录拉取
前端·git
间彧13 小时前
Git命令速查表
git
用户25191624271115 小时前
Git原理分析
前端·javascript·git
lsp-0716 小时前
Git版本控制与协作
git
百思可瑞教育1 天前
Git 对象存储:理解底层原理,实现高效排错与存储优化
大数据·git·elasticsearch·搜索引擎
Bitup_bitwin1 天前
Git智能合并机制深度解析
git
TeleostNaCl2 天前
OpenWrt 编译 | 一种使用 git submodule 方式实现一键更新多个外部软件包
网络·经验分享·git·智能路由器