Hello, I'm a newbie in gatsby, everytime I try to create a gatsby site I am getting this error: Error: Command failed with exit code 1: npm install
I tried this : gatsby new gatsby-simplefolio https://github.com/cobidev/gatsby-simplefolio
$ gatsby new gatsby-simplefolio-2 https://github.com/cobidev/gatsby-simplefolio
info Creating new site from git: https://github.com/cobidev/gatsby-simplefolio.git
Cloning into 'gatsby-simplefolio-2'...
remote: Enumerating objects: 70, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 70 (delta 3), reused 48 (delta 0), pack-reused 0
Unpacking objects: 100% (70/70), 7.24 MiB | 528.00 KiB/s, done.
?[32msuccess?[39m Created starter directory layout
?[34minfo?[39m Installing packages...
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version
of core-js@3.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
> [email protected] install C:\Users\Abhik\Documents\Gatsby Practice & Projects\gatsby-simplefolio-2\node_modules\bufferutil
> node-gyp-build
'Projects\gatsby-simplefolio-2\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'C:\Users\Abhik\Documents\node-gyp-build\bin.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\babel-plugin-add-module-exports\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"}
(current: {"node":"14.14.0","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must
install peer dependencies yourself.
npm WARN [email protected] requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/[email protected] requires a peer of eslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/[email protected] requires a peer of eslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] || 2.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint@>=1.6.0 <7.0.0 but none is installed.
You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @mdx-js/react@^1.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install 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! C:\Users\Abhik\AppData\Roaming\npm-cache\_logs\2020-10-19T12_48_11_989Z-debug.log
ERROR
Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
- error.js:56 makeError
[npm]/[gatsby-cli]/[execa]/lib/error.js:56:11
- index.js:114 handlePromise
[npm]/[gatsby-cli]/[execa]/index.js:114:26
- task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5
- init-starter.js:142 install
[npm]/[gatsby-cli]/lib/init-starter.js:142:7
- init-starter.js:209 clone
[npm]/[gatsby-cli]/lib/init-starter.js:209:3
- init-starter.js:350 initStarter
[npm]/[gatsby-cli]/lib/init-starter.js:350:5
- create-cli.js:430
[npm]/[gatsby-cli]/lib/create-cli.js:430:7
Windows 10
node -v
v14.14.0
npm -v
6.14.8
Gatsby CLI version: 2.12.109
@abhik007 this should work in Windows (I asked somebody to confirm this right now, just in case). Can you try to remove some dependencies and create a minimal test case that breaks for you? It would have as few dependencies as you can get.
It's hard to tell what might cause this.
@abhik007 this should work in Windows (I asked somebody to confirm this right now, just in case). Can you try to remove some dependencies and create a minimal test case that breaks for you? It would have as few dependencies as you can get.
It's hard to tell what might cause this.
What I have to do , do I need to remove them from package.json?
I'm a beginner , just started learning Gatsby 2days ago , please help.
And one more thing, It worked fine for Gatsby starter hello world , but when I'm creating a site with other starters it is giving me this error everytime.
Hi @abhik007,
Can you confirm that this is happening for several different starters? We're not able to reproduce this here. Can you run npm list bufferutil inside the created site directory, and also paste the output of gatsby info --clipboard
Can you confirm that this is happening for several different starters? We're not able to reproduce this here. Can you run
npm list bufferutilinside the created site directory, and also paste the output ofgatsby info --clipboard
Hello @ascorbic
Here is the result
Abhik@DESKTOP-ROG1HTF MINGW64 ~/Documents/Gatsby Practice & Projects/my-awesome-site
$ npm list bufferutil
[email protected] C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site
`-- (empty)
Abhik@DESKTOP-ROG1HTF MINGW64 ~/Documents/Gatsby Practice & Projects/my-awesome-site
$ gatsby info --clipboard
System:
OS: Windows 10 10.0.17134
CPU: (2) x64 Intel(R) Pentium(R) CPU G3220 @ 3.00GHz
Binaries:
Node: 14.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.9.0 - /c/Python39/python
Browsers:
Chrome: 86.0.4240.111
Edge: Spartan (42.17134.1.0)
npmPackages:
gatsby: ^2.24.79 => 2.24.79
gatsby-image: ^2.4.21 => 2.4.21
gatsby-plugin-offline: ^3.2.33 => 3.2.33
gatsby-plugin-react-helmet: ^3.3.14 => 3.3.14
gatsby-source-filesystem: ^2.3.34 => 2.3.34
npmGlobalPackages:
gatsby-cli: 2.12.111
I updated the gatsby-cli today, still getting error but changed a little bit
$ gatsby new my-awesome-site
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'my-awesome-site'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 29 (delta 2), reused 13 (delta 0), pack-reused 0
Unpacking objects: 100% (29/29), 644.00 KiB | 273.00 KiB/s, done.
?[32msuccess?[39m Created starter directory layout
?[34minfo?[39m Installing packages...
> [email protected] install C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
info sharp Using cached C:\Users\Abhik\AppData\Roaming\npm-cache\_libvips\libvips-8.9.1-win32-x64.tar.gz
info sharp Creating C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site\node_modules\sharp\vendor\lib to C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site\node_modules\sharp\build\Release
'Projects\my-awesome-site\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'C:\Users\Abhik\Documents\prebuild-install\bin.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Users\Abhik\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Abhik\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Abhik\Documents\Gatsby Practice & Projects\my-awesome-site\node_modules\sharp
gyp ERR! node -v v14.14.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install 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! C:\Users\Abhik\AppData\Roaming\npm-cache\_logs\2020-10-24T03_42_37_545Z-debug.log
ERROR
Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
- error.js:56 makeError
[npm]/[gatsby-cli]/[execa]/lib/error.js:56:11
- index.js:114 handlePromise
[npm]/[gatsby-cli]/[execa]/index.js:114:26
- task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5
- init-starter.js:142 install
[npm]/[gatsby-cli]/lib/init-starter.js:142:7
- init-starter.js:209 clone
[npm]/[gatsby-cli]/lib/init-starter.js:209:3
- init-starter.js:350 initStarter
[npm]/[gatsby-cli]/lib/init-starter.js:350:5
- create-cli.js:430
[npm]/[gatsby-cli]/lib/create-cli.js:430:7
Do I have to install Visual Studio and C++ for using gatsbyjs?
'Projects\my-awesome-site\node_modules.bin\' is not recognized as an internal or external command
This line implies that the problem could be because of spaces in your path. Your current directory name is Gatsby Practice & Projects. Try using a directory name without spaces? I am not sure if it will help but we should rule out this thing first.
Also having this exact same error now as well, no spaces in my directory.
Hi @abhik007,
Can you confirm that this is happening for several different starters? We're not able to reproduce this here. Can you runnpm list bufferutilinside the created site directory, and also paste the output ofgatsby info --clipboard
Having the same problem on Mac OS X Catalina (10.15.7)
npm bufferutils
[email protected] /Users/jeremiahshafer/Desktop/Projects/my-blog
โโโฌ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโฌ @graphql-tools/[email protected]
โ โโโฌ [email protected]
โ โโโ [email protected] deduped
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โโโฌ [email protected]
โโโฌ [email protected]
โโโ [email protected] deduped
And here is gatsby info --clipboard
System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 15.1.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.0.8 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.183
Firefox: 82.0.2
Safari: 14.0
npmPackages:
gatsby: ^2.25.3 => 2.25.3
gatsby-image: ^2.4.21 => 2.4.21
gatsby-plugin-manifest: ^2.5.2 => 2.5.2
gatsby-plugin-offline: ^3.3.3 => 3.3.3
gatsby-plugin-react-helmet: ^3.3.14 => 3.3.14
gatsby-plugin-sharp: ^2.7.1 => 2.7.1
gatsby-source-filesystem: ^2.4.2 => 2.4.2
gatsby-transformer-sharp: ^2.5.21 => 2.5.21
npmGlobalPackages:
gatsby-cli: 2.12.117
Do I need to install windows production build tools for getting rid of that error, I searched for it and in some similar issues in GitHub and stack overflow people are suggesting for installing Windows production build tools that comes with the visual studio c++ and python, please anyone answer do I need that.
Same issue here !
44973 verbose stack Error: [email protected] install: `node-gyp-build`
44973 verbose stack Exit status 1
44973 verbose stack at EventEmitter.<anonymous> (E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
44973 verbose stack at EventEmitter.emit (events.js:315:20)
44973 verbose stack at ChildProcess.<anonymous> (E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
44973 verbose stack at ChildProcess.emit (events.js:315:20)
44973 verbose stack at maybeClose (internal/child_process.js:1048:16)
44973 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
44974 verbose pkgid [email protected]
44975 verbose cwd E:\Travail\excelltoit
44976 verbose Windows_NT 10.0.18363
44977 verbose argv "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
44978 verbose node v14.15.0
44979 verbose npm v6.14.8
44980 error code ELIFECYCLE
44981 error errno 1
44982 error [email protected] install: `node-gyp-build`
44982 error Exit status 1
44983 error Failed at the [email protected] install script.
44983 error This is probably not a problem with npm. There is likely additional logging output above.
44984 verbose exit [ 1, true ]
Still no update on this issue? I'm having the same problem.
$ npm list bufferutil
[email protected] /home/wyvern/Dev/gatsby-blog
โโโ (empty)
$ gatsby info --clipboard
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: (4) x64 Intel(R) Celeron(R) CPU N2940 @ 1.83GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 15.3.0 - ~/.config/nvm/versions/node/v15.3.0/bin/node
npm: 6.14.9 - ~/.config/nvm/versions/node/v15.3.0/bin/npm
Browsers:
Chrome: 87.0.4280.66
Firefox: 83.0
npmGlobalPackages:
gatsby-cli: 2.14.1
I found a fix to this, I just cd-ed to my project directory and ran npm install.
Ok. I guess we kind of assumed that step had been covered. Glad to hear you resolved it.
Most helpful comment
Also having this exact same error now as well, no spaces in my directory.