Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote js css files disappeared after hexo d or git push [strange .gitignore bug with macOS: deploy can't work correctly] #37

Closed
3 tasks done
MARGI3 opened this issue Jan 15, 2018 · 38 comments

Comments

@MARGI3
Copy link

MARGI3 commented Jan 15, 2018

I agree and want to create new issue


Expected behavior

page reder correctly

Actual behavior

css file , js file not found (404)

Steps to reproduce the behavior

mkdir github_page

cd github_page

hexo init

git clone https://github.com/theme-next/hexo-theme-next themes/next

cd themes/next

git tag -l

//v6.0.0
//v6.0.1

git checkout tags/v6.0.1

//commit id da9cdd2

then back to github_page folder

open root _config.yml file

config theme and deploy

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:MARGI3/margi3.github.io.git
  branch: master

hexo g

npm install hexo-deployer-git --save

//+ hexo-deployer-git@0.3.1
//added 16 packages in 4.365s

hexo d

these all my steps

Node.js and NPM Information

v8.9.4

5.6.0

Package dependencies Information

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.4.4"
  },
  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-deployer-git": "^0.3.1",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.0",
    "hexo-renderer-marked": "^0.3.0",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-server": "^0.2.0"
  }
}

Hexo Information

Hexo version

hexo: 3.4.4
hexo-cli: 1.0.4
os: Darwin 17.2.0 darwin x64
http_parser: 2.7.0
node: 8.9.4
v8: 6.1.534.50
uv: 1.15.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
nghttp2: 1.25.0
openssl: 1.0.2n
icu: 59.1
unicode: 9.0
cldr: 31.0.1
tz: 2017b

Hexo Configuration

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Hexo
subtitle:
description:
author: John Doe
language:
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace:
  
# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date
  
# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:MARGI3/margi3.github.io.git
  branch: master

NexT Information

NexT Version:

[] Latest Master branch.
[x] Latest Release version.
[] Old version -

NexT Scheme:

[] All schemes
[] Muse
[] Mist
[] Pisces
[] Gemini

NexT Configuration:

STANDART CONFIG
...
# Theme version
version: 6.0.1

Other Information

  • local public files

wx20180115-215826 2x

  • local .deploy_git files

wx20180115-215735 2x

  • preview with hexo s

wx20180115-220011 2x

  • when i hexo d , or push to the github remote

wx20180115-220837 2x

wx20180115-215909 2x

Summary

i know the causes which lead to the page render error (files not exist), but i was really confused that why these files can not push to the remote.

local files are generated correctly , but when i push to github fews files seems like are rejected by the github

@MARGI3
Copy link
Author

MARGI3 commented Jan 15, 2018

i have tried with Next 5.x version, also can not render correctly.
i have tried with others theme just like hexo material, everything run smoothly
And i have found few people got the same problem.

@maple3142
Copy link
Contributor

Try to use git push instead of hexo d?

@ivan-nginx
Copy link
Member

Ok, i'll check it later. It's really strange because basic libs (like velocity) must deployed anyway.

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 15, 2018

@maple3142 hexo d is standart deploy command and it's must work with at least basic libs. It's very strange.

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 15, 2018

I think your deployment command is not correct:

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:MARGI3/margi3.github.io.git
  branch: master

Try this:

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: https://github.com/your-name/repo-name.git
  branch: gh-pages
  message: "Updated: {{ now('YYYY-MM-DD HH:mm:ss') }}"
  name: your-name
  email: your-mail@gmail.com

@MARGI3
Copy link
Author

MARGI3 commented Jan 16, 2018

@ivan-nginx

i have changed the _config.yml file

# Deployment
## Docs: https://hexo.io/docs/deployment.html
# deploy:
#  type: git
#  repo: git@github.com:MARGI3/margi3.github.io.git
#  branch: master

deploy:
  type: git
  repo: https://github.com/MARGI3/margi3.github.io.git
  branch: master
  message: "Updated: {{ now('YYYY-MM-DD HH:mm:ss') }}"
  name: margi3
  email: 562224864cross@gmail.com

and then i delete the content of root public folder

hexo g

hexo d

wx20180116-135011 2x

still not work

wx20180116-135106 2x

@MARGI3
Copy link
Author

MARGI3 commented Jan 16, 2018

@maple3142

i also have tried your resolver

delete content of public folder

delete content of .deploy_git folder exclude .git

hexo g

copy the content of public folder to the .deploy_git

cd to the .deploy_git folder

then git push -f to the remote

wx20180116-140131 2x

still not work

wx20180116-140453 2x

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 16, 2018

Try to reproduce this steps:

  1. Reinstall Hexo & NexT with clean settings. No need to modify orignal .gitignore file in NexT v6.
  2. Install hexo-deployer-git plugin.
  3. In root Hexo config _config.yml:
    url: https://margi3.github.io
    
    theme: next
    
    deploy:
      type: git
      repo: https://github.com/MARGI3/margi3.github.io.git
      branch: gh-pages
      message: "Updated: {{ now('YYYY-MM-DD HH:mm:ss') }}"
      name: margi3
      email: 562224864cross@gmail.com
  4. U have only master branch. Need create gh-pages branch in margi3.github.io repo:
    image
    And choose gh-pages branch in repo settings:
    image
  5. Then need to delete only .deploy_git directory. No need to copy or delete anything else.
  6. hexo clean && hexo g -d — will clear your public directory & generate local files and then deploy this generated local files into your gh-pages branch in margi3.github.io repo.
  7. After that if will still not work, report:
    1. Does lib directory exists in generated public dir? If yes, which dirs inside?
    2. Does lib directory exists in generated .deploy_git dir? If yes, which dirs inside?
    3. Full console log of hexo clean && hexo g -d command.

@MARGI3
Copy link
Author

MARGI3 commented Jan 17, 2018

@ivan-nginx

CONSOLE

➜  ~ npm install -g hexo-cli


/Users/allen/.nvm/versions/node/v8.9.4/bin/hexo -> /Users/allen/.nvm/versions/node/v8.9.4/lib/node_modules/hexo-cli/bin/hexo
+ hexo-cli@1.0.4
updated 1 package in 27.995s


➜  ~ cd workspace/github_page 
➜  github_page hexo init


INFO  Cloning hexo-starter to ~/workspace/github_page
Cloning into '/Users/allen/workspace/github_page'...
remote: Counting objects: 62, done.
remote: Total 62 (delta 0), reused 0 (delta 0), pack-reused 62
Unpacking objects: 100% (62/62), done.
Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'
Cloning into '/Users/allen/workspace/github_page/themes/landscape'...
Submodule path 'themes/landscape': checked out '73a23c51f8487cfcd7c6deec96ccc7543960d350'
INFO  Install dependencies
npm WARN deprecated swig@1.4.2: This package is no longer maintained
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-TFfVNASnYdjy58HooYpH2/J4pxk= integrity checksum failed when using sha1: wanted sha1-TFfVNASnYdjy58HooYpH2/J4pxk= but got sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==. (9232 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-wMGjdXUy1H5bfZ3JCLXf2YyUviw= integrity checksum failed when using sha1: wanted sha1-wMGjdXUy1H5bfZ3JCLXf2YyUviw= but got sha512-XN8pYJU+Wr3dT8ipqEPRlOBySJpd1C5NUBBzgZpVSVBC/6L36O0YZI/Qd5NxQqwfGfSuKQ8N5iMyjmRXSR1MdA==. (1935 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8= integrity checksum failed when using sha1: wanted sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8= but got sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==. (16514 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8= integrity checksum failed when using sha1: wanted sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8= but got sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==. (16514 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

> fsevents@1.1.3 install /Users/allen/workspace/github_page/node_modules/fsevents
> node install

[fsevents] Success: "/Users/allen/workspace/github_page/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm notice created a lockfile as package-lock.json. You should commit this file.
added 431 packages in 28.042s
INFO  Start blogging with Hexo!


➜  github_page npm install hexo-deployer-git --save


WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo= integrity checksum failed when using sha1: wanted sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo= but got sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==. (7889 bytes)
WARNWARN  registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk= integrity checksum failed when using sha1: wanted sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk= but got sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==. (7823 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8= integrity checksum failed when using sha1: wanted sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8= but got sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==. (16514 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-ry87iPpvXB5MY00aD46sT1WzleM= integrity checksum failed when using sha1: wanted sha1-ry87iPpvXB5MY00aD46sT1WzleM= but got sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==. (69241 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
+ hexo-deployer-git@0.3.1
added 16 packages in 12.732s




➜  github_page git clone https://github.com/theme-next/hexo-theme-next themes/next


Cloning into 'themes/next'...
remote: Counting objects: 785, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 785 (delta 9), reused 14 (delta 5), pack-reused 758
Receiving objects: 100% (785/785), 681.96 KiB | 281.00 KiB/s, done.
Resolving deltas: 100% (319/319), done.



➜  github_page cd themes/next
➜  next git:(master) git tag -l


v6.0.0
v6.0.1


➜  next git:(master) git checkout tags/v6.0.1

Note: checking out 'tags/v6.0.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at da9cdd2... Release v6.0.1

➜  next git:(da9cdd2) cd ..
➜  themes cd ..
➜  github_page 

➜  github_page hexo clean
➜  github_page hexo g -d
INFO  Start processing
INFO  Files loaded in 572 ms
INFO  Generated: index.html
...
 create mode 100644 lib/font-awesome/HELP-US-OUT.txt
 create mode 100644 lib/font-awesome/bower.json
 create mode 100644 lib/font-awesome/css/font-awesome.css
 create mode 100644 lib/font-awesome/css/font-awesome.css.map
 create mode 100644 lib/font-awesome/css/font-awesome.min.css
 create mode 100644 lib/font-awesome/fonts/fontawesome-webfont.eot
 create mode 100644 lib/font-awesome/fonts/fontawesome-webfont.woff
 create mode 100644 lib/font-awesome/fonts/fontawesome-webfont.woff2
 delete mode 100644 placeholder
To https://github.com/MARGI3/margi3.github.io.git
 + cba1b80...e618a46 HEAD -> gh-pages (forced update)
Branch master set up to track remote branch gh-pages from https://github.com/MARGI3/margi3.github.io.git.
INFO  Deploy done: git

SETTING

set root _config.yml files like below (after git pull and checkout tags/v6.0.1)

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: https://github.com/MARGI3/margi3.github.io.git
  branch: gh-pages
  message: "Updated: {{ now('YYYY-MM-DD HH:mm:ss') }}"
  name: margi3
  email: 562224864cross@gmail.com

github default branch setting

wx20180117-145850 2x

RESULT

still not work

wx20180117-150511 2x

Local Files

wx20180117-151507 2x

wx20180117-151528 2x

wx20180117-151548 2x

wx20180117-151614 2x

wx20180117-151633 2x

wx20180117-151655 2x

wx20180117-151732 2x

wx20180117-151754 2x

CAUSE?

i have got some warning

WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo= integrity checksum failed when using sha1: wanted sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo= but got sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==. (7889 bytes)

is that was the cause?

@maple3142
Copy link
Contributor

try rm package-lock.json and npm i

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 17, 2018

It's strange. Font-Awesome is deploy, but other 3 libs not deployed, but they was generated.

@MARGI3 ok, try to edit .gitignore in NexT root to this:

.DS_Store
.idea/
*.log
*.iml
yarn.lock
package-lock.json
node_modules/

# Ignore optional external libraries
source/lib/*

# Track internal libraries & Ignore unused verdors files
source/lib/font-awesome/less/
source/lib/font-awesome/scss/
!source/lib/font-awesome/*

-!source/lib/jquery/
+!source/lib/jquery/*

source/lib/ua-parser-js/
-!source/lib/ua-parser-js/dist/
+!source/lib/ua-parser-js/dist/*

-!source/lib/velocity/
+!source/lib/velocity/*

@theme-next theme-next deleted a comment from maple3142 Jan 17, 2018
@MARGI3
Copy link
Author

MARGI3 commented Jan 18, 2018

@ivan-nginx

I use my another computer (Mac mini), do the same operation, then success!
(pre one is Macbook pro)

wx20180118-110605

wx20180118-110446

So, I think it must be my computer npm/node/hexo configuration difference lead to the WRONG result.

another computer console output like below and the process is no WARN appeared

CONSOLE

➜  github_page npm install -g hexo-cli
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo

> fsevents@1.1.3 install /usr/local/lib/node_modules/hexo-cli/node_modules/fsevents
> node install

[fsevents] Success: "/usr/local/lib/node_modules/hexo-cli/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
- arrify@1.0.1 node_modules/hexo-cli/node_modules/arrify
...

➜  github_page hexo init
INFO  Cloning hexo-starter to ~/workspace/github_page
Cloning into '/Users/bili/workspace/github_page'...
remote: Counting objects: 62, done.
remote: Total 62 (delta 0), reused 0 (delta 0), pack-reused 62
Unpacking objects: 100% (62/62), done.
Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'
Cloning into '/Users/bili/workspace/github_page/themes/landscape'...
Submodule path 'themes/landscape': checked out '73a23c51f8487cfcd7c6deec96ccc7543960d350'
INFO  Install dependencies
npm WARN deprecated swig@1.4.2: This package is no longer maintained

> fsevents@1.1.3 install /Users/bili/workspace/github_page/node_modules/fsevents
> node install

[fsevents] Success: "/Users/bili/workspace/github_page/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
hexo-site@0.0.0 /Users/bili/workspace/github_page
├─┬ hexo@3.4.4 
...

➜  github_page git clone https://github.com/theme-next/hexo-theme-next themes/next
Cloning into 'themes/next'...
remote: Counting objects: 799, done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 799 (delta 15), reused 22 (delta 9), pack-reused 758
Receiving objects: 100% (799/799), 694.74 KiB | 105.00 KiB/s, done.
Resolving deltas: 100% (325/325), done.
➜  github_page cd themes/next
➜  next git:(master) git tag -l
v6.0.0
v6.0.1
➜  next git:(master) git checkout tags/v6.0.1
Note: checking out 'tags/v6.0.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at da9cdd2... Release v6.0.1
➜  next git:(da9cdd2) cd .. 
➜  themes cd ..
➜  github_page hexo g -d
INFO  Start processing
INFO  Files loaded in 733 ms
INFO  Generated: index.html
...
 create mode 100644 lib/font-awesome/HELP-US-OUT.txt
 create mode 100644 lib/font-awesome/bower.json
 create mode 100644 lib/font-awesome/css/font-awesome.css
 create mode 100644 lib/font-awesome/css/font-awesome.css.map
 create mode 100644 lib/font-awesome/css/font-awesome.min.css
 create mode 100644 lib/font-awesome/fonts/fontawesome-webfont.eot
 create mode 100644 lib/font-awesome/fonts/fontawesome-webfont.woff
 create mode 100644 lib/font-awesome/fonts/fontawesome-webfont.woff2
 create mode 100644 lib/jquery/index.js
 create mode 100644 lib/ua-parser-js/dist/ua-parser.min.js
 create mode 100644 lib/ua-parser-js/dist/ua-parser.pack.js
 create mode 100644 lib/velocity/velocity.js
 create mode 100644 lib/velocity/velocity.min.js
 create mode 100644 lib/velocity/velocity.ui.js
 create mode 100644 lib/velocity/velocity.ui.min.js
 delete mode 100644 placeholder
Username for 'https://github.com': MARGI3
Password for 'https://MARGI3@github.com': 
To https://github.com/MARGI3/margi3.github.io.git
 + 660660d...fad7e0e HEAD -> gh-pages (forced update)
Branch master set up to track remote branch gh-pages from https://github.com/MARGI3/margi3.github.io.git.
INFO  Deploy done: git
➜  github_page hexo d
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
On branch master
nothing to commit, working tree clean
To https://github.com/MARGI3/margi3.github.io.git
 + 39dd421...fad7e0e HEAD -> master (forced update)
Branch master set up to track remote branch master from https://github.com/MARGI3/margi3.github.io.git.
INFO  Deploy done: git

VERSION

➜  github_page node -v 
v6.3.1
➜  github_page hexo -v
hexo: 3.4.4
hexo-cli: 1.0.4
os: Darwin 16.1.0 darwin x64
http_parser: 2.7.0
node: 6.3.1
v8: 5.0.71.57
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h

RESOLVER

Is there any official tutorial to reinstall node js, npm, hexo ? maybe it can help me.

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 18, 2018

Your previous version of node was v8.9.4, current is v6.3.1 as i see. U can try to install NVM and play around with switch versions of node.

NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
nvm --version
0.33.6
nvm alias default system
nvm install node
nvm install lts/boron
nvm install lts/argon
nvm install iojs
nvm install 0.12
nvm install 0.10
nvm use default
nvm ls
$ nvm current
system

$ nvm use 8
Now using node v8.8.1 (npm v5.4.2)

$ nvm current
v8.8.1

$ nvm use system
Now using system version of node: v6.12.2 (npm v3.10.10)

$ nvm current
system

@MARGI3
Copy link
Author

MARGI3 commented Jan 18, 2018

Ok, when I back to home, I will try this. Thanks!

@MARGI3
Copy link
Author

MARGI3 commented Jan 19, 2018

@ivan-nginx

still not work

here are the two computer config

Mac mini (result success)

nvm list

➜  github_page nvm list
->       v6.3.1
         system
default -> 6.3.1 (-> v6.3.1)
node -> stable (-> v6.3.1) (default)
stable -> 6.3 (-> v6.3.1) (default)
iojs -> N/A (default)
lts/* -> lts/argon (-> N/A)
lts/argon -> v4.4.7 (-> N/A)

npm config

➜  github_page npm config ls -l
; cli configs
long = true
user-agent = "npm/3.10.3 node/v6.3.1 darwin x64"

...

hexo -v

➜  github_page hexo -v
hexo: 3.4.4
hexo-cli: 1.0.4
os: Darwin 16.1.0 darwin x64
http_parser: 2.7.0
node: 6.3.1
v8: 5.0.71.57
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h

MacbookPro (result failed)

nvm list

➜  github_page nvm list
->       v6.3.1
default -> 6.3.1 (-> v6.3.1)
node -> stable (-> v6.3.1) (default)
stable -> 6.3 (-> v6.3.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.12.3 (-> N/A)
lts/carbon -> v8.9.4 (-> N/A)

npm config

➜  github_page npm config ls -l
; cli configs
long = true
user-agent = "npm/3.10.3 node/v6.3.1 darwin x64"

...

hexo v

➜  github_page hexo v
hexo: 3.4.4
hexo-cli: 1.0.4
os: Darwin 17.2.0 darwin x64
http_parser: 2.7.0
node: 6.3.1
v8: 5.0.71.57
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 19, 2018

Please, don't need post too long logs, i can't to find previous messages.


Try to reproduce steps above.

@MARGI3
Copy link
Author

MARGI3 commented Jan 22, 2018

@ivan-nginx

i have followed the step, but still not work.

@ivan-nginx
Copy link
Member

@MARGI3 what's your git version on each device?

$ git --version

@MARGI3
Copy link
Author

MARGI3 commented Jan 22, 2018

@ivan-nginx both 2.10.1

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 22, 2018

@MARGI3 can u IN SHORT WORDS give configuration from 1 and 2 device? All possible versions of soft (from OS to Node) and, especially, try to say about difference and in what mean be trouble as u think (for example, fsevents or what kind of errors u see)? DONT NEED TO SHOW LONG LOGS please. Just short:

Device 1 (REPRODUCE STEPS ABOVE SUCCESS):

  • OS: ...
  • Console: ...
  • Hardware: ...
  • Node: ...
    ...

Device 2 (REPRODUCE STEPS ABOVE ERROR):

  • OS: ...
  • Console: ...
  • Hardware: ...
  • Node: ...
    ...

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 22, 2018

I see only difference for now: all *.js files not deploying.
Not only from lib directory, but also from js/scr directory: utils.js, bootstrap.js, etc.

img

This files never ignored by NexT .gitignore and always must be deployed 6.x version and in 5.x version too.


I also not see js directory in public dir:

img

I'm not sure, but maybe something like AV of Firewall blocked your all JS files when u deploy it.

Anyway, it's not NexT bug, a fortiori u see what in another device reproduce steps are work fine.

@MARGI3
Copy link
Author

MARGI3 commented Jan 22, 2018

@ivan-nginx

Device 1 (REPRODUCE STEPS ABOVE SUCCESS):

  • OS: macOS Sierra Version 10.12.1 (16B2657)
  • Console: console output just see see above that i had post above
  • Hardware: Mac mini (Late 2014)
  • Node: v6.3.1
  • Hexo:
hexo-cli: 1.0.4
os: Darwin 16.1.0 darwin x64
http_parser: 2.7.0
node: 6.3.1
v8: 5.0.71.57
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h
  • NVM
->       v6.3.1
         system
default -> 6.3.1 (-> v6.3.1)
node -> stable (-> v6.3.1) (default)
stable -> 6.3 (-> v6.3.1) (default)
iojs -> N/A (default)
lts/* -> lts/argon (-> N/A)
lts/argon -> v4.4.7 (-> N/A)

Device 2 (REPRODUCE STEPS ABOVE ERROR):

  • OS: macOS High Sierra Version 10.13.1 (17B1003)
  • Console: console output just see see above that i had post above
  • Hardware: MacBook Pro (Retina, 13-inch, Early 2015)
  • Node: v6.3.1
  • Hexo:
hexo: 3.4.4
hexo-cli: 1.0.4
os: Darwin 17.2.0 darwin x64
http_parser: 2.7.0
node: 6.3.1
v8: 5.0.71.57
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h
  • NVM
->       v6.3.1
default -> 6.3.1 (-> v6.3.1)
node -> stable (-> v6.3.1) (default)
stable -> 6.3 (-> v6.3.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.12.3 (-> N/A)
lts/carbon -> v8.9.4 (-> N/A)

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 22, 2018

Any AV? Something which cause block javascript?
Update/Reinstall Git? Trying to use another theme with *.js files give same error?
Something block javascript files inside system and this is not NexT theme bug.

@MARGI3
Copy link
Author

MARGI3 commented Jan 22, 2018

I had tried material theme , got the same problem.

I was really confused with it .

@MARGI3
Copy link
Author

MARGI3 commented Jan 22, 2018

I just want to got the reason. As you mentioned it may be the OS problem , but i just want to resolver the problem , so first i should know the reason.

@ivan-nginx
Copy link
Member

ivan-nginx commented Jan 22, 2018

Check all possible AV/Firewalls. Hosts files, etc.
Try to download js files directly.
Then try to download js files with any Github tool.
Then try to use another deployer (not github, heroku for example).

U just need to filter your bug. If bug in Git — check only Git with all possible tools.

@ivan-nginx ivan-nginx changed the title remote js css files disappeared after hexo d or git push remote js css files disappeared after hexo d or git push [strange bug with MacbookPro: deploy can't work correctly] Mar 17, 2018
@recherst
Copy link

recherst commented May 11, 2018

@MARGI3 so at least, did you resolve this problem? recently i have same problem with you.
some info below
node: v6.11.1
npm: 6.6.0
system: 10.13.4
git version: 2.15.1
hope you reply

@MARGI3
Copy link
Author

MARGI3 commented May 16, 2018

@RecherJ I resolve this problem, but maybe not work for you. I downgrade my macbookpro system version from 10.13 to 10.12. Then do the same step to publish, everything runs smoothly.

so, although the problem was resolved, i still don't know the reason.

@recherst
Copy link

recherst commented Jun 2, 2018

@MARGI3 hi, recently i fixed this problem by using git add -f xxx/ to force tracking these untracked files. but i didn't understand why this repo can't track some files cause there is no .gitignore file.

@Henryyichao
Copy link

REALLY?I tried git add -f xxx/but failed

@jiangtj
Copy link
Member

jiangtj commented Dec 21, 2018

@Henryyichao
Run hexo clean before hexo d, may be work

@ivan-nginx
Copy link
Member

Or delete git directory before hexo d.

It's really strange bug which wasn't solved to this day.

@littp
Copy link

littp commented Mar 1, 2019

Or delete git directory before hexo d.

It's really strange bug which wasn't solved to this day.

解决了! #636

macOS 之前的git忽略文件包含lib,删掉就好

vi ~/.gitignore_global

#lib

image

@ivan-nginx ivan-nginx changed the title remote js css files disappeared after hexo d or git push [strange bug with MacbookPro: deploy can't work correctly] Remote js css files disappeared after hexo d or git push [strange bug with MacbookPro: deploy can't work correctly] Apr 1, 2019
@theme-next theme-next locked as resolved and limited conversation to collaborators Apr 1, 2019
@stevenjoezhang
Copy link
Contributor

谢谢各位,有关macOS上.gitignore问题的相关文档已在网站上更新。

@stevenjoezhang stevenjoezhang changed the title Remote js css files disappeared after hexo d or git push [strange bug with MacbookPro: deploy can't work correctly] Remote js css files disappeared after hexo d or git push [strange .gitignore bug with macOS: deploy can't work correctly] Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants