Giter VIP home page Giter VIP logo

hexo-cli's Introduction

hexo-cli

CI NPM version Coverage Status

Command line interface for Hexo.

Installation

$ npm install hexo-cli -g

Development

  1. Fork this project
  2. $ git clone https://github.com/user/hexo-cli --recurse-submodules && cd hexo-cli/
  3. $ npm install
  4. $ npm test

License

MIT

hexo-cli's People

Contributors

alefteris avatar brelian avatar cokemine avatar curbengh avatar d-sketon avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dimaslanjaka avatar jamiewq avatar jlhwung avatar leesei avatar noahdragon avatar segayuu avatar stevenjoezhang avatar sukkaw avatar sumimakito avatar tcrowe avatar tomap avatar tommy351 avatar uiolee avatar weyusi avatar wyattjoh avatar xu-song avatar xuanwo avatar yoshinorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexo-cli's Issues

try `loadModule` in process.cwd

If I specify cwd, hexo-cli will loadModule in it to find local hexo. But my structure will break it.

|- docs                <- cwd of hexo project
  |- _config.yml
  `- other files
|- node_modules
  `- hexo             <- where hexo really is 
`- package.json

I will install dependencies in the directory where I run hexo --cwd docs, but it can't find hexo becuase it's not under docs/node_modules.

I think hexo-cli can try loadModule in process.cwd if it can't find it under cwd.

add a CLI command to create new themes

Hey guys ๐Ÿ‘‹
First and foremost, thank you all for maintaining this awesome project.

I was just reading the Themes section in the docs and I didn't find anything related to a CLI command to create a new theme. I also didn't find anything in previous issues.

Wouldn't be cool to have something similar? Or do you guys think this is not necessary?

Hexo CLI fresh Ubuntu install generating zero-length files

I recently created a new Ubuntu 20.04 install. I installed NodeJS from the NodeSource repo, and installed hexo-cli with npm i -g hexo-cli (as root). Then, I cloned my repository, ran npm i, then hexo g. All the files that it should have generated are there (and listed to the console); however, every single file has a zero length - there's no content!

hexo s does show the content, so I know it's able to read the various templates and put them all together. It's a strange scenario; I'm happy to provide any more information you may need to diagnose or reproduce this.

My hexo --version:

hexo: 4.2.0
hexo-cli: 3.1.0
os: Linux 5.4.0-33-generic linux x64
node: 14.3.0
v8: 8.1.307.31-node.33
uv: 1.37.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.16.0
modules: 83
nghttp2: 1.40.0
napi: 6
llhttp: 2.0.4
openssl: 1.1.1g
cldr: 37.0
icu: 67.1
tz: 2019c
unicode: 13.0

When we remove hexo in package.json,the generate(or any other command) action won't work

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
//  "hexo": {
//    "version": "5.2.0"
//  },
  "dependencies": {
    "hexo": "^5.0.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^3.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^2.0.0"
  }
}

image

Feature request: Improving Bash completion

Check List

Please check followings before submitting a new feature request.

  • I have already read Docs page
  • I have already searched existing issues

Feature Request

  • Make it possible to complete without using Bashrc snippet.
  • Currently, only the help, init, and version subcommands are complemented. Options such as --config should also be completed.

Others

Package.json name

Hi!

I think that the init command should change the value of the name property in the generated package.json file.

ๆŠฅ้”™

Gh0st# hexo clean
[Error: Module did not self-register.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
ERROR Plugin load failed: hexo-generator-feed
ReferenceError: hexo is not defined
at Object. (/Users/ippotsuko/blog/node_modules/hexo-generator-feed/feed.js:4:10)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (/Users/ippotsuko/blog/node_modules/hexo/lib/hexo/index.js:213:21)
at /Users/ippotsuko/blog/node_modules/hexo-generator-feed/index.js:6:30
at /Users/ippotsuko/blog/node_modules/hexo/lib/hexo/index.js:229:12
at tryCatcher (/Users/ippotsuko/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/Users/ippotsuko/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/Users/ippotsuko/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/Users/ippotsuko/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/Users/ippotsuko/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:79:16)
at Async._drainQueues (/Users/ippotsuko/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:89:10)
at Immediate.Async.drainQueues as _onImmediate
at processImmediate as _immediateCallback
INFO Deleted database.

macๅทฒ่ฃ…xcodeๅ’Œๅ‘ฝไปค่กŒๅทฅๅ…ท node็‰ˆๆœฌ0.12

Should hexo-cli package bundles with hexo-starter and hexo-theme-landscape?

Recently I tried to test some plugins in a fresh Windows, I created a dummy blog with hexo init but forgot to install Git beforehand.

try {
await spawn('git', ['clone', '--recurse-submodules', '--depth=1', '--quiet', GIT_REPO_URL, target], {
stdio: 'inherit'
});
} catch (err) {
log.warn('git clone failed. Copying data instead');
await copyAsset(target);
}

The git command failed and copyAsset() is executed instead.

async function copyAsset(target) {
await copyDir(ASSET_DIR, target, { ignoreHidden: false });
}

That failed too because "assets/" folder (a submodule that points to hexo-starter) is not published.

I can think of two approaches:

  1. Publish "assets/" folder.
  2. Remove copyAsset() and check git existence before running L30: if (!commandExistsSync('git')) log.warn('Please install git')

@hexojs/core

Pandoc 2.x support

When I run hexo g or hexo s, I get:

Error: pandoc exited with code 2: --smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.                                                                     

Plugin management

Feature idea: command-line plugin management

  • hexo plugin enable (hexo-)generator-feed => add entry in plugins in _config.yml + add default/example plugin config (extracted from package.json for instance)
  • hexo plugin disable (hexo-)generator-feed => remove entry in plugins
  • hexo plugin search => npm search hexo-
  • hexo plugin install (hexo-)generator-feed=> npm install hexo-generator-feed && hexo plugin enable hexo-generator-feed
  • hexo plugin remove (hexo-)generator-feed=> hexo plugin disable hexo-generator-feed && npm remove hexo-generator-feed
  • hexo plugin list/list-installed => list installed plugins

What do you think?

Hexo messes up CMD text color

ref hexojs/hexo#1711

source below:

When using some commands Hexo will change the color of my text in the command prompt. The problem is that it never changes the color back again. Look at the example below where it changes the text color from orange to red.

CMD TEXT CHANGE

Are there any ways to prevent this? It's a bit annoying.

A bug regarding init project with a hexadecimal name

Is this a BUG REPORT or FEATURE REQUEST?
Maybe It's a bug.
What version you use:

hexo-cli: 3.1.0
os: Linux 4.4.0-18362-Microsoft linux x64
http_parser: 2.9.3
node: 10.20.1
v8: 6.8.275.32-node.56
uv: 1.34.2
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 64
nghttp2: 1.39.2
napi: 6
openssl: 1.1.1e
icu: 64.2
unicode: 12.1
cldr: 35.1
tz: 2019c

What happened:

When I execute hexo init 0x400, It will create a project named 1024 instead of 0x400. Always appears this issue when the target project is a Hexadecimal or Octal number. More instances,
bug-hexo-init-0x400

$ hexo init 070  ==> create folder named: 70
$ hexo init 0xAB ==> create folder named: 171

What you expected to happen:

When I execute hexo init 0x400, I expect to initialize the project into the 0x400 folder.

How to reproduce it (as minimally and precisely as possible):

hexo init 0x400

Anything else we need to know?:

It seems this issue introduces by minimist. It aways parses as a number with leading 0x.

Hexo init failed on `git clone`

Check List

Please check followings before submitting a new feature request.

  • [Y] I have already read Docs page
  • [Y ] I have already searched existing issues

Feature Request

Execute
hexo init blog in my window10.
Tips is

INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
fatal: unable to access 'https://github.com/hexojs/hexo-starter.git/': Recv failure: Connection was reset
WARN  git clone failed. Copying data instead
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html

I execute the cmd:

git clone --recurse-submodules --depth=1 --quiet https://github.com/hexojs/hexo-starter.git blog

It's not work. But if I execute the below cmd:

git clone --recurse-submodules --depth=1 --quiet [email protected]:hexojs/hexo-starter.git blog

It's work.

So I changed $basedir/node_model/hexo_cli/dist/console/init.js
rewite GIT_REPO_URL as [email protected]:hexojs/hexo-starter.git;
And redo hexo init blog.

It's work.

I think it's a point you can improve.

Others

hexo init

This problem occurs on hexo init
Error: ENOENT: no such file or directory, scandir '/usr/lib/node_modules/hexo-cli/assets'

ๆœชๆณจๅ…ฅ hexo-util ไธŽ moment ๅˆฐ้กน็›ฎ

Check List

  • I have already read README.
  • I have already searched existing issues and they are not help to me.
  • I examined error or warning messages and it's difficult to solve.
  • I am using the latest version of this repository.
  • I am using the latest version of Hexo.
  • My Node.js is matched the required version.

Describe the bug

ๅœจไฝฟ็”จpnpm iๅŽๆ‰ง่กŒ hexo seๅŽๅ‘็Žฐ็ผบๅฐ‘ไธคไธชๅŒ…๏ผŒๅˆ†ๅˆซๆ˜ฏ๏ผš'hexo-util'ใ€'moment'

Expected behavior

ๅœจไฝฟ็”จpnpm iๅŽๆ‰ง่กŒ hexo seๅŽๅ‘็Žฐ็ผบๅฐ‘ไธคไธชๅŒ…๏ผŒๅˆ†ๅˆซๆ˜ฏ๏ผš'hexo-util'ใ€'moment'

How to reproduce

  1. hexo init
  2. delete node_moudle
  3. pnpm i
  4. hexo se

Screenshots

No response

Environment information

No response

Additional context

No response

Just a dev question - Why extend from eventEmitter when the methods are never used (hexo-cli) ?

Why have class Context extend EventEmitter at all ? in the package hexoc-cli i don't see the methods of EventEmitter used at all, so why extend from this class ?

I see context is defined HERE like so :-

class Context extends EventEmitter { // code here }

and then ofcourse being used in the index(hexo.ts) file like so LINK :-

function entry(cwd = process.cwd(), args) {
  args = camelCaseKeys(
      args || minimist(process.argv.slice(2), 
      { string: ['_', 'p', 'path', 's' ,'slug'] 
  }));

  let hexo = new Context(cwd, args);
  // more code here
}

Release v2.0.0

Does someone would you please release a v2.0.0? (Current master branch has breaking changes)

We are receiving some comments of vulnerability issue of package dependencies in hexojs/hexo#3475 from users.

Sorry, I haven't permission to publish npm.
If publish I will write a release note & release news.

Thanks :)

Failed at the [email protected] build:highlight script.

when I run sudo npm i -g hexo-cli, I got the following error.

/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo

> [email protected] install /usr/local/lib/node_modules/hexo-cli/node_modules/fsevents
> node install


> [email protected] install /usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider
> node scripts/install.js


> [email protected] postinstall /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> npm run build:highlight


> [email protected] build:highlight /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

sh: 1: cannot create highlight_alias.json: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build:highlight: `node scripts/build_highlight_alias.js > highlight_alias.json`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build:highlight script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                npm update check failed                โ”‚
โ”‚          Try running with sudo or get access          โ”‚
โ”‚         to the local update config store via          โ”‚
โ”‚ sudo chown -R $USER:$(id -gn $USER) /home/ljn/.config โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ljn/.npm/_logs/2017-07-19T06_24_27_819Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] postinstall: `npm run build:highlight`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ljn/.npm/_logs/2017-07-19T06_24_29_497Z-debug.log

Is it a problem with npm? How to solve it ?

yarn support

It would be great if when running hexo init it would use yarn if the user has it installed, and fall-back to npm if not.

The behavior of `hexo g` is affected by `new_post_name`

With hexo-cli 1.1.0
image
image

With hexo-cli 1.0.4
image

My post files in both _posts/almond and _posts/beechnut. But in the latest hexo-cli, it's generated wrong.

I only changed this config:

new_post_name: beechnut/:title.md

new_post_name shouldn't affect hexo g.

hexo ๅ‘ฝไปคๅชๆœ‰help init version ไธ‰ไธชcommand ๅฎ˜็ฝ‘ๆ–นๆณ•ๆœช่งฃๅ†ณ

ๆ นๆฎๅฎ˜็ฝ‘ๆŠŠ่ฟ™ไธ€ๆฎตๅ†…ๅฎนๆ”พๅˆฐpackage.jsonไธญๅŽ ๆŠฅ้”™ๅฆ‚ไธ‹

{
--
"hexo": {
"version": "3.2.2"
}
}

FATAL Cannot read property 'code' of undefined
TypeError: Cannot read property 'code' of undefined
at /home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/lib/find_pkg.js:21:26
at tryCatcher (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:439:21)

fs.SyncWriteStream is deprecated

There's deprecation warning while using with Node.js 8

(node:65160) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.

New version of Highlight.js breaks npm installation

Issue

Can't run npm install hexo-cli -g right now - seems to be caused by the new version of Highlight.js (released ~5 hours ago at the time of writing).
Works if you also install highlight.js at the same time, but using the previous version (9.14.2).

Error message

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/danp3d/.nvm/versions/node/v10.12.0/lib/node_modules/hexo-cli/node_modules/highlight.js/tools/build.js'
npm ERR! enoent This is related to npm not being able to find a file.

How to reproduce

npm uninstall -g hexo-cli
npm install -g hexo-cli

Workaround

npm install -g [email protected] hexo-cli

hexo generage doesn't work

I've tried to build hexo-site almost one hour, but didn't solve this problem:

ERROR Error: Cannot find module 'cuid'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/suevalov/Development/projects/test/node_modules/hexo/node_modules/warehouse/lib/types/cuid.js:5:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/suevalov/Development/projects/test/node_modules/hexo/node_modules/warehouse/lib/types/index.js:9:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/suevalov/Development/projects/test/node_modules/hexo/node_modules/warehouse/lib/schema.js:4:13)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
Unhandled rejection TypeError: Cannot read property 'then' of undefined
    at /Users/suevalov/Development/projects/test/node_modules/hexo-cli/lib/index.js:82:21
    at tryCatcher (/Users/suevalov/Development/projects/test/node_modules/hexo-cli/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/Users/suevalov/Development/projects/test/node_modules/hexo-cli/node_modules/bluebird/js/main/promise.js:503:31)
    at Promise._settlePromiseAt (/Users/suevalov/Development/projects/test/node_modules/hexo-cli/node_modules/bluebird/js/main/promise.js:577:18)
    at Async._drainQueue (/Users/suevalov/Development/projects/test/node_modules/hexo-cli/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/Users/suevalov/Development/projects/test/node_modules/hexo-cli/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/suevalov/Development/projects/test/node_modules/hexo-cli/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:367:17)
hexo-cli: 0.1.8
os: Darwin 14.5.0 darwin x64
http_parser: 2.3
node: 0.12.7
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1p

Any suggestions?

Contact

Hi team,

I've tried to contact you via email, but there is no response.
Can you please contact me back - [email protected]

Thanks,

hexo-cli post install fails

$ sudo npm i -g hexo-cli                                                                                                                                                                            shark@dev
[sudo] password for shark: 
/usr/bin/hexo -> /usr/lib/node_modules/hexo-cli/bin/hexo

> [email protected] install /usr/lib/node_modules/hexo-cli/node_modules/dtrace-provider
> node scripts/install.js


> [email protected] postinstall /usr/lib/node_modules/hexo-cli/node_modules/hexo-util
> npm run build:highlight


> [email protected] build:highlight /usr/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

sh: highlight_alias.json: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:highlight: `node scripts/build_highlight_alias.js > highlight_alias.json`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:highlight script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              npm update check failed              โ”‚
โ”‚        Try running with sudo or get access        โ”‚
โ”‚       to the local update config store via        โ”‚
โ”‚ sudo chown -R $USER:$(id -gn $USER) /root/.config โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/hexo-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `npm run build:highlight`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-08-29T17_15_30_204Z-debug.log

As you can see in the log file this is not npm fault or a permission error but hexo-cli post-install that fails. I tried on an updated manjaro (arch-based) and on a fresh installed Antergos (arch-based). I tried sudo npm install gulp-cli -g and it works.

/root/.npm/_logs/2017-08-29T17_15_30_204Z-debug.log: https://gist.github.com/noraj1337/66e214101b5cc0ea203eac30d4dd3f90

PS: I already installed successfully hexo-cli on this machine (manjaro) on the past and on various other arch-based systems.

`hexo init` failed, but `git clone` is okay

I'm trying the latest hexo-cli from GitHub.

$ hexo init
INFO  Cloning hexo-starter to ~/test
INFO  git clone failed. Copying data instead.
ERROR Error: ENOENT: no such file or directory, scandir '/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/assets'
    at Error (native)
Unhandled rejection TypeError: Cannot read property 'then' of undefined
    at /home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/lib/index.js:83:21
    at tryCatcher (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/util.js:11:23)
    at Promise._settlePromiseFromHandler (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:489:31)
    at Promise._settlePromise (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:546:18)
    at Promise._settlePromise0 (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:591:10)
    at Promise._settlePromises (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:670:18)
    at Promise._reject (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:634:18)
    at Promise._settlePromise (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:561:21)
    at Promise._settlePromise0 (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:591:10)
    at Promise._settlePromises (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:670:18)
    at Promise._reject (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:634:18)
    at Promise._rejectCallback (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:452:10)
    at ReductionPromiseArray.PromiseArray._reject (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise_array.js:136:19)
    at Promise._settlePromise (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:543:21)
    at Promise._settlePromise0 (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:591:10)
    at Promise._settlePromises (/home/leesei/.nvm/versions/node/v5.1.0/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:670:18)

$ git clone https://github.com/hexojs/hexo-starter.git .
Cloning into '.'...
remote: Counting objects: 24, done.
remote: Total 24 (delta 0), reused 0 (delta 0), pack-reused 23
Unpacking objects: 100% (24/24), done.
Checking connectivity... done.

Also:

HELP!!! [Error: EPERM: operation not permitted, mkdir 'D:\'

้’ˆๅฏน็ฎ€ไฝ“ไธญๆ–‡็”จๆˆท็š„ๆ็คบ๏ผšๅœจๆไบค issue ๆ—ถ่ฏทไธ่ฆๅˆ ้™คไธ‹้ข็š„ๆจกๆฟ๏ผŒๆŒ‰็…งๆญฅ้ชคๆไพ›็›ธๅ…ณไฟกๆฏๅฐ†ๆœ‰ๅŠฉไบŽๆˆ‘ไปฌ่ฐƒๆŸฅไฝ ็š„้—ฎ้ข˜ใ€‚่ฏทๅฐฝ้‡ไฝฟ็”จ่‹ฑ่ฏญๆ่ฟฐไฝ ็š„้—ฎ้ข˜๏ผŒ่ฟ™ๅฏไปฅ่ฎฉๆ›ดๅคš็š„ไบบๅธฎๅŠฉๅˆฐไฝ ใ€‚

If you find that markdown files are not rendered as expected, please go to https://marked.js.org/demo/ to see if it can be reproduced there. If it can be reproduced, please file a bug to https://github.com/markedjs/marked.

If you want help on your bug, please also send us the git repository (GitHub, GitLab, Bitbucket etc...) where your hexo code is stored. It would greatly help. If you prefer not to have your hexo code out in public, please upload to a private GitHub repository and grant read-only access to hexojs/core

Please take extra precaution not to attach any secret environment variables (likes password or GitHub Personal Access Token).

-->

Check List

Please check followings before submitting a new issue.

Question

When I want to init hexo ,there is an error saying [Error: EPERM: operation not permitted, mkdir 'D:'

Screenshot 2021-03-22 233608

Environment & Settings

Node.js & npm version

Node.js 15.12.0 
npm -7.6.3

Your site _config.yml (Optional)


Your theme _config.yml (Optional)


Hexo and Plugin version(npm ls --depth 0)

Your package.json package.json

nothing

Others

hexo init firstWeb fails

running latest node and latest hexo on linux:
hexo init firstWeb

produces error:
Unknown Syntax Error: Unsupported option name ("--production").

$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--cache-folder #0]
WARN Failed to install dependencies. Please run 'npm install' manually!

Stack trace:

Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
Cloning into '/home/vic/Documents/GitHub/m/h'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 161 (delta 12), reused 12 (delta 4), pack-reused 131
Receiving objects: 100% (161/161), 31.79 KiB | 2.27 MiB/s, done.
Resolving deltas: 100% (74/74), done.
Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'
Cloning into '/home/vic/Documents/GitHub/m/h/themes/landscape'...
remote: Enumerating objects: 1063, done.
remote: Total 1063 (delta 0), reused 0 (delta 0), pack-reused 1063
Receiving objects: 100% (1063/1063), 3.21 MiB | 8.29 MiB/s, done.
Resolving deltas: 100% (585/585), done.
Submodule path 'themes/landscape': checked out '73a23c51f8487cfcd7c6deec96ccc7543960d350'
INFO Install dependencies
Unknown Syntax Error: Unsupported option name ("--production").

$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--cache-folder #0]
WARN Failed to install dependencies. Please run 'npm install' manually!

plugin don't work when declare under devDependencies

When declare the plugin under devDependencies , even the plugin has been installed , for example :

  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.1.0",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-marked": "^0.2.10",
    "hexo-renderer-stylus": "^0.3.1"   
  },
  "devDependencies": {
    "hexo-server": "^0.2.0"
  }

then when you type hexo server , the output is :

$ hexo server
Usage: hexo <command>

Commands:
  clean     Removed generated files and cache.
  config    Get or set configurations.
  deploy    Deploy your website.
  generate  Generate static files.
  help      Get help on a command.
  init      Create a new Hexo folder.
  list      List the information of the site
  migrate   Migrate your site from other system to Hexo.
  new       Create a new post.
  publish   Moves a draft post from _drafts to _posts folder.
  render    Render files with renderer plugins.
  version   Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD
  --debug   Display all verbose messages in the terminal
  --draft   Display draft posts
  --safe    Disable all plugins and scripts
  --silent  Hide output on console

For more help, you can use 'hexo help [command]' for the detailed information
or you can check the docs: http://hexo.io/docs/

No scripts folder created with hexo init

Docs setup section mentions that hexo init should have created a scripts directory but when I run the command this folder was not created.

$ hexo version
hexo-cli: 0.1.7
os: Darwin 14.4.0 darwin x64
http_parser: 2.5.0
node: 2.3.4
v8: 4.2.77.20
uv: 1.6.1
zlib: 1.2.8
ares: 1.10.1-DEV
modules: 44
openssl: 1.0.2d

$ hexo init hexo-example
$ ls -la hexo-example
.
..
.gitignore
_config.yml
package.json
scaffolds
source
themes

Should the docs be updated to remove it or the folder should be added to the hexo-cli init assets that are copied?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.