尝试安装hexo时出错

时间:2015-03-11 13:15:45

标签: node.js hexo

当我安装Hexo时,我收到此错误。我不知道发生了什么?有人能帮助我吗?

C:\Users\LiuHu>npm install hexo-cli -g
npm WARN optional dep failed, continuing fsevents@0.3.5
C:\Users\LiuHu\AppData\Roaming\npm\hexo -> C:\Users\LiuHu\AppData\Roaming\npm\no
de_modules\hexo-cli\bin\hexo
hexo-cli@0.1.4 C:\Users\LiuHu\AppData\Roaming\npm\node_modules\hexo-cli
├── abbrev@1.0.5
├── minimist@1.1.1
├── bluebird@2.9.13
├── tildify@1.0.0 (user-home@1.1.1)
├── chalk@1.0.0 (escape-string-regexp@1.0.3, ansi-styles@2.0.1, supports-colo
r@1.3.0, strip-ansi@2.0.1, has-ansi@1.0.3)
└── hexo-fs@0.1.3 (escape-string-regexp@1.0.3, graceful-fs@3.0.5, chokidar@0.
12.6)

当我运行此命令npm install时。它告诉我这个错误: D:\Document\Z_MYBlog_New>npm install

npm ERR! install Couldn't read dependencies

npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs

\\node_modules\\npm\\bin\\npm-cli.js" "install"

npm ERR! node v0.12.0

npm ERR! npm v2.5.1

npm ERR! path D:\Document\Z_MYBlog_New\package.json

npm ERR! code ENOPACKAGEJSON

npm ERR! errno -4058

npm ERR! package.json ENOENT, open 'D:\Document\Z_MYBlog_New\package.json'

npm ERR! package.json This is most likely not a problem with npm itself.

npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:

npm ERR! D:\Document\Z_MYBlog_New\npm-debug.log

在D:\ Document \ Z_MYBlog_New \ npm-debug.log这个日志文件中,它告诉我: 0 info it worked if it ends with ok

1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',

1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli 'install' ]

2 info using npm@2.5.1

3 info using node@v0.12.0

4 verbose node symlink C:\Program Files\nodejs\\node.exe

5 error install Couldn't read dependencies

6 verbose stack Error: ENOENT, open 'D:\Document\Z_MYBlog_New\package.json'

6 verbose stack at Error (native)

7 verbose cwd D:\Document\Z_MYBlog_New

8 error Windows_NT 6.1.7601

9 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"

10 error node v0.12.0

11 error npm v2.5.1

12 error path D:\Document\Z_MYBlog_New\package.json

13 error code ENOPACKAGEJSON

14 error errno -4058

15 error package.json ENOENT, open 'D:\Document\Z_MYBlog_New\package.json'

15 error package.json This is most likely not a problem with npm itself.

15 error package.json npm can't find a package.json file in your current directory.

16 verbose exit [ -4058, true ]

1 个答案:

答案 0 :(得分:2)

这是一个警告而不是错误

我建议你使用hexo 2.8.Now不要使用hexo 3.0。 因为hexo-server或hexo clean可能有一些错误会让你变坏。 npm install hexo@2.8 -g