0

当我安装 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 ]

4

1 回答 1

3

这是警告而不是错误

我建议你使用 hexo 2.8。现在不要使用 hexo 3.0。导致 hexo-server 或 hexo clean 可能有一些错误会让你变得糟糕。 npm install hexo@2.8 -g

于 2015-03-12T09:48:42.287 回答