【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
相关推荐
码农黛兮_4613 小时前
Git 常用命令大全
git
一弓虽13 小时前
git 学习
git·学习
疯狂的沙粒21 小时前
如何通过git命令查看项目连接的仓库地址?
大数据·git·elasticsearch
qq_254617771 天前
Gerrit+repo管理git仓库,如果本地有新分支不能执行repo sync来同步远程所有修改,会报错
git
π大星星️1 天前
Git分布式版本控制工具
分布式·git
kingbal1 天前
IDEA:配置 Git 需要完成 Git 路径设置、账号认证以及仓库关联三个主要步骤
git·idea
司徒小夜1 天前
处理git没做修改,但是文件显示变更的情况
git
m0_749317522 天前
vscode里如何用git
ide·git·vscode
Hello.Reader2 天前
Git 安装全攻略Linux、macOS、Windows 与源码编译
linux·git·macos
王景程2 天前
SELinux是什么以及如何编写SELinux策略
git·github