Gatsby failing to install with Starter. Build error - npm-install

Hi I would like to use a gatsby starter for a blog site. However when I use the command gatbsy new [name-of-project] [url-of-starter]
It shows these errors.
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/david/Desktop/blog/node_modules/sharp
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.21.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.21.3 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:
ERROR
Command failed with exit code 1 (EPERM): npm install
Error: Command failed with exit code 1 (EPERM): npm install
- error.js:58 makeError
[lib]/[gatsby-cli]/[execa]/lib/error.js:58:11
- index.js:112 handlePromise
[lib]/[gatsby-cli]/[execa]/index.js:112:26
- task_queues.js:85 processTicksAndRejections
internal/process/task_queues.js:85:5
I have tried uninstalling gatsby cli, yarn and npm to no prevail.
Thanks for any advice.
And the default starter works fine its when I use a starter thats the issue.

Related

Sharp returning errors on npm install for M1 Big Sur

I'm trying to install sharp for my project. When running npm i and npm install sharp, I am receiving the same errors about sharp (shown below). I've tried installing libvip globally and locally, and read about every thread about this issue and cannot seem to find the right solution. Any suggestions are welcome.
rosetta error: /var/db/oah/223263137464320_223263137464320/e6ddd63cd8fd3b7ef226e2cad9a1bead9d7f41f60d7ece6edd0cdcc0c33c97c6/libxcrun.dylib.aot: attachment of code signature supplement failed: 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: null
gyp ERR! stack at ChildProcess.onExit (/Users/elektra.murphy/.nvm/versions/node/v11.11.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/Users/elektra.murphy/.nvm/versions/node/v11.11.0/bin/node" "/Users/elektra.murphy/.nvm/versions/node/v11.11.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/elektra.murphy/Desktop/Projects/node_modules/sharp
gyp ERR! node -v v11.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/elektra.murphy/Desktop/Projects/package.json'
npm WARN No description
npm WARN No repository field.
npm WARN No README data
npm WARN No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.23.2 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.23.2 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! /Users/elektra.murphy/.npm/_logs/2021-10-12T08_24_48_579Z-debug.log
Found a solution for this in the Sharp docs: When using npm v6 or earlier, the npm install --unsafe-perm flag must be used when installing as root or a sudo user. Seems to have worked - now on to the next error!
Find more here on M1 installations:
https://sharp.pixelplumbing.com/install

Can't install appmetrics with npm

I'm trying to install access-watch with no success.
After cloning the repo I call npm i and I get the following error. It appears to occur when the installation process tries to install appmetrics. So I tried npm i appmetrics and got the exact same error, hence the title of this question.
Here's the tail of the trace,
$ cd access-watch
$ npm i
/home/gandalf/.cache/node-gyp/14.18.0/include/node/v8.h:6482:46: note: candidate expects 1 argument, 0 provided
Release/obj.target/appmetrics/geni/appmetrics.cpp: At global scope:
Release/obj.target/appmetrics/geni/appmetrics.cpp:641:13: warning: ‘bool isAppMetricsFile(std::__cxx11::string, std::__cxx11::string)’ defined but not used [-Wunused-function]
static bool isAppMetricsFile(std::string expected, std::string potentialMatch) {
^~~~~~~~~~~~~~~~
Makefile:282: recipe for target 'Release/obj.target/appmetrics/geni/appmetrics.o' failed
make: *** [Release/obj.target/appmetrics/geni/appmetrics.o] Error 1
make: Leaving directory '/home/gandalf/access-watch/node_modules/appmetrics/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Linux 4.15.0-66-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gandalf/access-watch/node_modules/appmetrics
gyp ERR! node -v v14.18.0
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appmetrics#4.0.1 install: `node extract_all_binaries.js || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appmetrics#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! /home/gandalf/.npm/_logs/2021-10-11T13_41_15_454Z-debug.log
And here's the full thing: https://pastebin.com/cYsHa1EP
I know node-gyp must be installed and it is:
$ node-gyp --version
v8.2.0
I found an issue in appmetric's github and ran with CC=gcc-9 but to no success.
Thanks!

Cannot install xml2json module using npm in Windows 10

I am trying to install xml2json using npm , but the console returns the following error
I run npm i xml2json
Then , the console returns this error
C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Users\VDSCH\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\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\VDSCH\AppData\Local\Programs\Python\Python37-32"", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\VDSCH\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN problemapp#1.0.0 No description
npm WARN problemapp#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat#2.3.18 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.3.18 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\VDSCH\AppData\Roaming\npm-cache\_logs\2019-06-26T16_59_24_765Z-debug.log
In the end i have tried reinstalling node-gyp and node expat but those dont seem to work. Is there something wrong with the package or am i missing something from my own system variables?
The error itself says something about not finding the python executable, and asking you to set the PYTHON environment variable to locate it.
So, the first question is, do you have python installed? If not, you should install it.
Then, before you run the process again, set the PYTHON environment variable to locate it.

Can not Install sharp

sharp#0.18.4 install C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
node-gyp rebuild
C:\Users\hp\AppData\Roaming\npm\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN { Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN stack: 'Error: EPERM: operation not permitted, rmdir \'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\'',
npm WARN errno: -4048,
npm WARN code: 'EPERM',
npm WARN syscall: 'rmdir',
npm WARN path: 'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.18.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.18.4 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\hp\AppData\Roaming\npm-cache\_logs\2017-12-27T19_25_54_261Z-debug.log
the easiest way to install sharp on windows OS is to use the following npm package
which is called windows-build-tools
npm install --global --production windows-build-tools
this as npm says it downloads
installs Visual C++ Build Tools, provided free of charge by Microsoft. These tools are required to compile popular native modules. It will also install Python 2.7, configuring your machine and npm appropriately.
after this npm install sharp

Not able to install bcrypt

aakanksha#aakanksha:~/Documents/shoutbox/node_modules$ sudo npm install bcrypt
> bcrypt#0.8.1 install / /home/aakanksha/Documents/shoutbox/node_modules/bcrypt
> node-gyp rebuild
make: Entering directory ` /home/aakanksha/Documents/shoutbox/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
make: g++: Command not found
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 127
make: Leaving directory `/home/aakanksha/Documents/shoutbox/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.13.0-44-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node- gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/aakanksha/Documents/shoutbox/node_modules/bcrypt
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.13.0-44-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "bcrypt"
npm ERR! node v0.10.36
npm ERR! npm v2.6.0
npm ERR! code ELIFECYCLE
npm ERR! bcrypt#0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.8.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/aakanksha/Documents/shoutbox/node_modules/npm- debug.log
I am getting this error while installing bcrypt.I have tried following things:
npm install -g npm
sudo npm i -g node-gyp && node-gyp clean
But even after running above commands,if i agin install bcrypt it gives me error.