安装Hexo时遇上的问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yr12Dong/article/details/82051787

在安装Hexo-Server报错

C:\Users\ASUS>npm install hexo-server --save
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\ASUS\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\ASUS\package.json'
npm WARN ASUS No description
npm WARN ASUS No repository field.
npm WARN ASUS No README data
npm WARN ASUS No license field.

解决方案
看这句提示,是因为缺少 package.json 这个文件。
首先,初始化项目,一路回车就行

npm init -f

接着安装依赖

npm install formidable --save

重新输入

C:\Users\ASUS>npm install hexo-server --save
npm WARN ASUS@1.0.0 No description
npm WARN ASUS@1.0.0 No repository field.

+ hexo-server@0.3.2
updated 1 package in 5.417s

看上去成功了

hexo server 指令无效 Usage: hexo
= =应该先用

$ hexo init <folder>
$ cd <folder>
$ npm install

建立资源文件夹 然后再

hexo server

猜你喜欢

转载自blog.csdn.net/yr12Dong/article/details/82051787