【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
相关推荐
naice1 天前
我对github的图片很不爽了,于是用AI写了一个图片预览插件
前端·javascript·git
会飞的青蛙1 天前
GIT 配置别名&脚本自动化执行
前端·git
权咚3 天前
阿权的开发经验小集
git·ios·xcode
nightunderblackcat4 天前
新手向:Git下载全攻略
git
若无_4 天前
了解 .husky:前端项目中的 Git Hooks 工具
前端·git
想当花匠的小码农4 天前
Git 仓库“减肥”指南:从检测、清理到同步的全流程实践
git
R_.L4 天前
Git : 基本操作
git
python_1365 天前
git常见冲突场景及解决办法
git
洛小豆5 天前
Git 打标签完全指南:从本地创建到远端推送
前端·git·github