Error: Command failed with exit code 1: npm install
See original GitHub issueDescription
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
Steps to reproduce
I tried this : gatsby new gatsby-simplefolio https://github.com/cobidev/gatsby-simplefolio
Actual result
$ 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated @hapi/formula@2.0.0: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated core-js@2.6.11: 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 resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
> bufferutil@4.0.1 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 fsevents@1.2.13: 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 fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: 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: watchpack-chokidar2@2.0.0
npm WARN bootstrap@4.5.3 requires a peer of jquery@1.9.1 - 3 but none is installed. You must
install peer dependencies yourself.
npm WARN bootstrap@4.5.3 requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/eslint-plugin@2.34.0 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/parser@2.34.0 requires a peer of eslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@5.2.1 requires a peer of eslint@6.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@5.2.1 requires a peer of eslint-plugin-react-hooks@1.x || 2.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@2.2.1 requires a peer of eslint@>=1.6.0 <7.0.0 but none is installed.
You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 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 acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN theme-ui@0.2.52 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! bufferutil@4.0.1 install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bufferutil@4.0.1 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
Environment
Windows 10 node -v v14.14.0
npm -v 6.14.8
Gatsby CLI version: 2.12.109
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:26 (6 by maintainers)
Top Results From Across the Web
How to solve npm install error “npm ERR! code 1”
try with deleting package-lock.json file and node_module folder then run npm cache clean --force. And try npm i again to install packages. If...
Read more >Error: Command failed with exit code 1: npm install. - Reddit
I got the same error after upgrading to Gatsby 5 and node 18.
Read more >Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
The “Make Failed with Exit Code 2” error occurs during the node modules installation. We see lots of stack trace including the one...
Read more >Build command failed with exit code 1 - Netlify Support Forums
I have build errors which i didn't have before in previous deploys, although my webpack config hasn't changed. Also my previous deploys ...
Read more >npm install -> Error: Process completed with exit code 1
gyp ERR! build error npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 npm ERR ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hay @abhik007
this also happen with me
Here is solution
$ npm cache clean or npm cache clean --force
then
$ rm -rf node_modules package-lock.json
then
$ npm install
if Socket timeout again use command npm install
$ npm run develop
then
now its work
Also having this exact same error now as well, no spaces in my directory.