【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
相关推荐
happyness4415 小时前
Git:AI编程时代的“安全带“与“时光机“
git·ai编程
To_OC15 小时前
踩坑无数!终于捋顺Git基础核心工作流(新手必看)
git·程序员
xuhaoyu_cpp_java20 小时前
Git学习(三)
经验分享·笔记·git·学习
C137的本贾尼21 小时前
Git基本操作(二):add与commit,把文件交给Git管理
git
咸鱼永不翻身1 天前
Git Hooks—提交Commit前检查本地时间是否不对
git·git-hooks·git钩子
John_ToDebug1 天前
如何针对指定目录生成 Git Patch 并精准应用到其他分支
chrome·git
Joy T1 天前
【Web3】Hardhat工程架构中Solidity与TypeChain的协作机制
git·架构·typescript·web3·智能合约·hardhat·typechain
步十人1 天前
【Git】基础概念与在vscode中的简单使用
git
代码中介商1 天前
Git 版本控制完全指南:从分支管理到远程协作
linux·git
无风听海1 天前
git fsck 深度解析 Git 仓库的体检医生
git