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

npm 7 cannot be used to initialize the blog(something wrong with node-gyp) #4775

Closed
5 tasks done
SekiBetu opened this issue Sep 12, 2021 · 2 comments
Closed
5 tasks done

Comments

@SekiBetu
Copy link

SekiBetu commented Sep 12, 2021

Check List

Please check followings before submitting a new issue.

Expected behavior

initialize the hexo blog successfully

Actual behavior

error about node-gyp

How to reproduce?

  • Install Nodejs v14.17.6 and upgrade npm to 7.23.0
  • install hexo-cli
  • use hexo init to initialize the blog

Is the problem still there under "Safe mode"?

yes

Environment & Settings

Node.js & npm version(node -v && npm -v)

v14.17.6
7.23.0

Others

when using npm 7.23.0

PS S:\hexo> npm --version
7.23.0
PS S:\hexo> npm install hexo-cli -g

added 1 package, and changed 57 packages in 4s
PS S:\hexo> hexo init blog
INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO  Install dependencies
WARN  Failed to install dependencies. Please run 'npm install' in "S:\hexo\blog" folder.
PS S:\hexo> cd blog
PS S:\hexo\blog> npm install
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! code 1
npm ERR! path S:\hexo\blog\node_modules\canvas
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.17.6 | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "S:\develop\Python\Python38\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\SekiBetu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (child_process.js:397:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "S:\\develop\\Nodejs\\node.exe" "C:\\Users\\SekiBetu\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd S:\hexo\blog\node_modules\canvas
npm ERR! gyp ERR! node -v v14.17.6
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SekiBetu\AppData\Local\npm-cache\_logs\2021-09-12T09_30_23_889Z-debug.log

when using npm 6.14.15

PS S:\hexo\blog> npm --version
6.14.15
PS S:\hexo\blog> hexo init
INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO  Install dependencies
added 242 packages from 207 contributors in 16.452s

15 packages are looking for funding
  run `npm fund` for details

INFO  Start blogging with Hexo!
PS S:\hexo\blog>
@SekiBetu
Copy link
Author

#4769
npm/cli#2839

@SekiBetu
Copy link
Author

SekiBetu commented Oct 17, 2021

fixed in npm 8.1.0
nodejs/node-gyp#2392 (comment)

PS S:\test> npm --version
8.1.0
PS S:\test> hexo init
INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO  Install dependencies
INFO  Start blogging with Hexo!

@SekiBetu SekiBetu changed the title npm 7 cannot be used to initialize the blog npm 7 cannot be used to initialize the blog(something wrong with node-gyp) Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant