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

Error when run "npm install -g hexo-cli" #3466

Closed
wadmes opened this issue Feb 25, 2019 · 22 comments
Closed

Error when run "npm install -g hexo-cli" #3466

wadmes opened this issue Feb 25, 2019 · 22 comments
Labels

Comments

@wadmes
Copy link

wadmes commented Feb 25, 2019

Environment Info

System:
Win10 64bit

Node version(node -v):
11.10.0 (10.15,1 also does not work for me)

the consele output is:

`PS C:\Windows\system32> npm install -g hexo-cli
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
npm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Program Files\nodejs\node_modules\hexo-cli\node_modules\fsevents\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\hexo-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! path C:\Program Files\nodejs\node_modules\hexo-cli\node_modules\highlight.js\tools\build.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Program Files\nodejs\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.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\neway\AppData\Roaming\npm-cache\_logs\2019-02-25T09_41_38_938Z-debug.log
PS C:\Windows\system32> node -v`

For BUG

Cannot install hexo

For feature request

@digitalap3
Copy link

digitalap3 commented Feb 25, 2019

same problem on a debian docker install that worked previously. I see package.json was updated 17 hours ago in hexo-cli so I wonder if that caused the problem

edit: I'm getting the same error when trying to install highlight.js by itself whereas mocha installs fine. Looking at their github page it seems they are working on it. I'm seeing commits from 5 mins ago.

edit 2: here is the issue tracker for the problem: highlightjs/highlight.js#1984

@fasei
Copy link

fasei commented Feb 25, 2019

I have the same problem.

@KatherineWZS
Copy link

me too

npm ERR! path /usr/local/lib/node_modules/hexo-cli/node_modules/highlight.js/tools/build.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/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.

@tomap
Copy link
Contributor

tomap commented Feb 25, 2019

Yep, @digitalap3 you have the right link.
I believe you can still install by adding --ignore-scripts to the command

npm install -g hexo-cli --ignore-scripts (but I'm unsure of the impacts)

@LeoJhonSong
Copy link

same issue 😢

C:\Users\LeoJh>npm install -g hexo-cli
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
npm WARN rollback Rolling back glob@7.1.3 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\globby\node_modules'
npm WARN rollback Rolling back node-pre-gyp@0.10.3 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\fsevents\node_modules'
npm WARN rollback Rolling back liftoff@2.0.3 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\hexo-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! path C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\highlight.js\tools\build.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\LeoJh\AppData\Roaming\npm\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.
npm ERR! enoent

looking forward to the solution 💪

@FFshine
Copy link

FFshine commented Feb 25, 2019

same

@tomap
Copy link
Contributor

tomap commented Feb 25, 2019

The issue comes from highlight.js
The dependency chain is hexo-cli > hexo-util@0.6.3 > highlight.js@9.15.2
but highlight.js version 9.15.2 was supposed to solve the issue

@cpp288
Copy link

cpp288 commented Feb 25, 2019

same

@codeOct
Copy link

codeOct commented Feb 25, 2019

npm ERR! path /Users/jiatuo/.nvm/versions/node/v8.0.0/lib/node_modules/hexo-cli/node_modules/highlight.js/tools/build.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/jiatuo/.nvm/versions/node/v8.0.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.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jiatuo/.npm/_logs/2019-02-25T15_40_13_196Z-debug.log

@codeOct
Copy link

codeOct commented Feb 25, 2019

同样的问题 😢

C:\Users\LeoJh>npm install -g hexo-cli
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
npm WARN rollback Rolling back glob@7.1.3 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\globby\node_modules'
npm WARN rollback Rolling back node-pre-gyp@0.10.3 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\fsevents\node_modules'
npm WARN rollback Rolling back liftoff@2.0.3 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\hexo-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! path C:\Users\LeoJh\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\highlight.js\tools\build.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\LeoJh\AppData\Roaming\npm\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.
npm ERR! enoent

期待解决方案 💪

同样的问题,求解决

@JOduMonT
Copy link

JOduMonT commented Feb 25, 2019

same o on Debian Buster with NodeJS 10 from nodesource,
where hexo was working 2weeks ago
and even I purge my nodejs

@chocoluffy
Copy link

chocoluffy commented Feb 25, 2019

(Option 1)
npm install -g hexo-cli --ignore-scripts can help, as it simply download the packages without building it, thus it will avoid the error caused by dep package like here in highlight.js. But use it with caution, as it may cause other useful packages to stop building as well.

(Option 2)
I recommend install packages from your npm-shrinkwrap.json file instead of directly installing latest hexo-cli, as this package is currently affected by its deps highlight.js and waiting for fix.

So do npm shrinkwrap to generate above json file, and then npm install will install packages from shrinkwrap locked version, such that you are installing from a known working version, rather the latest one.

I encounter the same problem as title on Travis when deploying my hexo blog, and the above-mentioned tricks help solve the error.

@JOduMonT
Copy link

I'm able to hexo serve my hexo project/blog again

simply by executing npm shrinkwrap than npm install inside my hexo project
as proposed @chocoluffy in is Option 2

@imdingtalk
Copy link

同样的问题

@jiaming0708
Copy link

I can install now, nothing change

@digitalap3
Copy link

(Option 2)
I recommend install packages from your npm-shrinkwrap.json file instead of directly installing latest hexo-cli, as this package is currently affected by its deps highlight.js and waiting for fix.

So do npm shrinkwrap to generate above json file, and then npm install will install packages from shrinkwrap locked version, such that you are installing from a known working version, rather the latest one.

I encounter the same problem as title on Travis when deploying my hexo blog, and the above-mentioned tricks help solve the error.

That is awesome thank you!!! The upside of things like this happening is you learn new stuff like this.

@danp3d
Copy link

danp3d commented Feb 26, 2019

Just copying my workaround here (from my duplicated issue - sorry, my bad. I didn't see this one).
I fixed my CI/CD pipeline by replacing npm install -g hexo-cli with npm install -g highlight.js@9.14.2 hexo-cli (ensuring highlight.js was using the previous version).

Fixed my pipeline. Not a long term solution, but works as a stopgap.

@LeoJhonSong
Copy link

Just copying my workaround here (from my duplicated issue - sorry, my bad. I didn't see this one).
I fixed my CI/CD pipeline by replacing npm install -g hexo-cli with npm install -g highlight.js@9.14.2 hexo-cli (ensuring highlight.js was using the previous version).

Fixed my pipeline. Not a long term solution, but works as a stopgap.

Thanks very much! I got my hexo working properly by running npm install -g highlight.js@9.14.2 hexo-cli !

@tomap
Copy link
Contributor

tomap commented Feb 27, 2019

Latest version 9.15.6 is working fine!

@stale
Copy link

stale bot commented Apr 28, 2019

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 28, 2019
@stale stale bot closed this as completed May 5, 2019
@qingxueline
Copy link

I have the same problem.Why?

@babita-web
Copy link

Hi I have this problem any solution??

$ npm audit fix --force
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating @wordpress/scripts to 2.4.4,which is a SemVer major change.
npm WARN audit Updating gulp to 3.9.1,which is a SemVer major change.
npm WARN audit Updating gulp-imagemin to 4.1.0,which is a SemVer major change.
npm WARN deprecated @types/multimatch@4.0.0: This is a stub types definition. multimatch provides its own type definitions, so you do not need this installed.
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit https://github.com/lukeed/kleur/releases/tag/v3.0.0\ for migration path(s).
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see request/request#3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated babel-eslint@8.0.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated uuid@2.0.3: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@2.0.3: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests