I'm having problems building a project with MEAN.io. I run through all of the steps given by MEAN.io but I receive the following error:
npm ERR! Cannot read property '0' of undefined
Steps:
I created a brand new ubuntu instance with c9.
Upgraded npm to 5.3.0
Upgraded node with nvm to 8.2.1
Went to mean.io and followed there instructions
sudo npm install -g mean-cli
mean init testapp
got the following error
error:
Cloning into 'testapp'...
/home/ubuntu/.npm/_locks/npm-eb15ca27eba77bee.lock
/home/ubuntu/.npm/anonymous-cli-metrics.json
There are 3 files in your ~/.npm owned by root
Please change the permissions by running - chown -R `whoami` ~/.npm
/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/mean-cli/lib/install.js:52
if (err) throw err;
^
ROOT PERMISSIONS IN NPM
ran the following command: sudo chown -Rwhoami~/.npm
Deleted the testapp folder that mean init created
Rerean the command: mean init testapp
Appears that the project was successfully created
I got the following message:
message:
Install node package dependencies:
$ cd testapp && npm install
Bower install should be triggered for client side dependencies.
If it did not run invoke it manually...
$ cd testapp && bower install
Run the app by running:
$ cd testapp and then run..
$ gulp
ran cd testapp && npm install
Got the following output
output:
> node-sass#4.5.3 install /home/ubuntu/workspace/testapp/node_modules/node-sass
> node scripts/install.js
Cached binary found at /home/ubuntu/.npm/node-sass/4.5.3/linux-x64-57_binding.node
> node-sass#4.5.3 postinstall /home/ubuntu/workspace/testapp/node_modules/node-sass
> node scripts/build.js
Binary found at /home/ubuntu/workspace/testapp/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
> angular-starter#6.0.0 postinstall /home/ubuntu/workspace/testapp
> npm run webdriver:update
> angular-starter#6.0.0 webdriver:update /home/ubuntu/workspace/testapp
> webdriver-manager update
[19:17:48] I/file_manager - creating folder /home/ubuntu/workspace/testapp/node_modules/protractor/node_modules/webdriver-manager/selenium
[19:17:49] I/update - chromedriver: unzipping chromedriver_2.31.zip
[19:17:49] I/update - chromedriver: setting permissions to 0755 for /home/ubuntu/workspace/testapp/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.31
[19:17:50] I/update - geckodriver: unzipping geckodriver-v0.18.0.tar.gz
[19:17:50] I/update - geckodriver: setting permissions to 0755 for /home/ubuntu/workspace/testapp/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.18.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Tried running gulp but got an error
error:
[17:50:10] Local gulp not found in ~/workspace/testapp
[17:50:11] Try running: npm install gulp
Tried running npm install gulp (tried sudo as well) but got the following error
error:
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.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN #angular/compiler-cli#4.0.3 requires a peer of #angular/compiler#4.0.3 but none was installed.
npm WARN #angular/compiler-cli#4.0.3 requires a peer of #angular/core#4.0.3 but none was installed.
npm WARN angular2-universal#2.1.0-rc.1 requires a peer of zone.js#~0.6.21 but none was installed.
npm WARN apollo-server#0.3.3 requires a peer of graphql#^0.6.1 || ^0.7.0 but none was installed.
npm ERR! Cannot read property '0' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-07-26T17_52_19_821Z-debug.log
Here is a bit of output from the log file
2238 verbose unlock done using /home/ubuntu/.npm/_locks/staging-719b6a82c67d40a4.lock for /home/ubuntu/workspace/testapp/node_modules/.staging
2239 warn #angular/compiler-cli#4.0.3 requires a peer of #angular/compiler#4.0.3 but none was installed.
2240 warn #angular/compiler-cli#4.0.3 requires a peer of #angular/core#4.0.3 but none was installed.
2241 warn angular2-universal#2.1.0-rc.1 requires a peer of zone.js#~0.6.21 but none was installed.
2242 warn apollo-server#0.3.3 requires a peer of graphql#^0.6.1 || ^0.7.0 but none was installed.
2243 verbose stack TypeError: Cannot read property '0' of undefined
2243 verbose stack at rmStuff (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/lib/unbuild.js:61:24)
2243 verbose stack at tryCatcher (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2243 verbose stack at ret (eval at makeNodePromisifiedEval (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
2243 verbose stack at lifecycle.then.then (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/lib/install/action/unbuild.js:12:12)
2243 verbose stack at tryCatcher (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2243 verbose stack at Promise._settlePromiseFromHandler (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
2243 verbose stack at Promise._settlePromise (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
2243 verbose stack at Promise._settlePromise0 (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
2243 verbose stack at Promise._settlePromises (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
2243 verbose stack at Async._drainQueue (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
2243 verbose stack at Async._drainQueues (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
2243 verbose stack at Immediate.Async.drainQueues (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
2243 verbose stack at runCallback (timers.js:781:20)
2243 verbose stack at tryOnImmediate (timers.js:743:5)
2243 verbose stack at processImmediate [as _immediateCallback] (timers.js:714:5)
2244 verbose cwd /home/ubuntu/workspace/testapp
2245 verbose Linux 4.9.17-c9
2246 verbose argv "/home/ubuntu/.nvm/versions/node/v8.2.1/bin/node" "/home/ubuntu/.nvm/versions/node/v8.2.1/bin/npm" "install" "gulp"
2247 verbose node v8.2.1
2248 verbose npm v5.3.0
2249 error Cannot read property '0' of undefined
2250 verbose exit [ 1, true ]
Any idea what went wrong?
It is the problem with npm#5.3.0 . Try downgrading the npm by following command and npm install again.
npm install -g npm#5.2.0
Related
i have a clone from a big app on my system, after i ran npm install, this is my log:
arash_sh#Arashs-MacBook-Pro talentcoach-web % npm install
npm WARN deprecated react-persian-calendar-date-picker#1.1.6: react-persian-calendar-datepicker is deprecated! please use the new react-modern-calendar-datepicker https://kiarash-z.github.io/react-modern-calendar-datepicker
npm WARN deprecated #formatjs/intl-unified-numberformat#3.3.7: We have renamed the package to #formatjs/intl-numberformat
npm WARN deprecated eslint-loader#2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated core-js#2.6.12: 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 ant-design-palettes#1.1.3: Please use #ant-design/colors to replace ant-design-palettes
npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
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 fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated core-js#1.2.7: 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 circular-json#0.3.3: CircularJSON is in maintenance only, flatted is its successor.
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 left-pad#1.3.0: use String.prototype.padStart()
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
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
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
> fsevents#1.2.13 install /Users/arash_sh/Desktop/LDI/IranTalent/talentcoach-web/node_modules/fsevents
> node install.js
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.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/arash_sh/Desktop/LDI/IranTalent/talentcoach-web/node_modules/fsevents
gyp ERR! node -v v14.9.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> core-js#2.6.12 postinstall /Users/arash_sh/Desktop/LDI/IranTalent/talentcoach-web/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> core-js-pure#3.8.2 postinstall /Users/arash_sh/Desktop/LDI/IranTalent/talentcoach-web/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
> core-js#3.8.2 postinstall /Users/arash_sh/Desktop/LDI/IranTalent/talentcoach-web/node_modules/react-app-polyfill/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for react-lottie#1.2.3: wanted: {"npm":"^3.0.0"} (current: {"node":"14.9.0","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: react-lottie#1.2.3
npm WARN slick-carousel#1.8.1 requires a peer of jquery#>=1.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app#2.1.0 requires a peer of babel-eslint#^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app#2.1.0 requires a peer of eslint-plugin-jsx-a11y#^5.1.1 but none is installed. You must install peer dependencies yourself.
added 2287 packages from 1103 contributors and audited 2291 packages in 110.296s
79 packages are looking for funding
run `npm fund` for details
found 80 vulnerabilities (72 low, 3 moderate, 5 high)
run `npm audit fix` to fix them, or `npm audit` for details
and after that when i ran npm start this is my log:
> talentcoach-web#0.0.1 prestart /Users/arash_sh/Desktop/LDI/IranTalent/talentcoach-web
> yarn clean
sh: yarn: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! talentcoach-web#0.0.1 prestart: `yarn clean`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the talentcoach-web#0.0.1 prestart 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/arash_sh/.npm/_logs/2021-01-08T17_16_26_747Z-debug.log
i know project is on razzle.
I think you need to download and install XCode
gyp: No Xcode or CLT version detected!
I just did a git clone off a starter template on Gatsby-- bumped into this error when I ran 'gatsby develop'. I've deleted the node module, as well as the sharp module in node module. To no avail.
Do let me know what's going on at this point! :-)
PS C:\Users\ipche\gatsby-strapi-starter> gatsby develop
success open and validate gatsby-configs - 0.073s
ERROR
Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp.node'
Require stack:
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\lib\constructor.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\lib\index.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\safe-sharp.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\extend-node-type.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\gatsby-node.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby\dist\bootstrap\resolve-module-exports.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby\dist\bootstrap\load-plugins\validate.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby\dist\bootstrap\load-plugins\load.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby\dist\bootstrap\load-plugins\index.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby\dist\bootstrap\index.js
- C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby\dist\commands\develop-process.js
- C:\Users\ipche\gatsby-strapi-starter\.cache\tmp-19076-nq3SvOAJn7yo
- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues
Ran 'npm build' here
C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\src\stats.cc(130,1): error C2661: 'v8::Object::Set': no overloa
ded function takes 2 arguments [C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\build\sharp.vcxproj]
C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\src\stats.cc(140,20): warning C4834: discarding return value of
function with 'nodiscard' attribute [C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\build\sharp.vcxproj]
C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\src\pipeline.cc(1017,20): warning C4834: discarding return valu
e of function with 'nodiscard' attribute [C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp\build\sharp.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\ipche\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ipche\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"
"rebuild"
gyp ERR! cwd C:\Users\ipche\gatsby-strapi-starter\node_modules\gatsby-transformer-sharp\node_modules\sharp
gyp ERR! node -v v14.13.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.22.1 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.22.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\ipche\AppData\Roaming\npm-cache\_logs\2020-10-06T21_03_57_721Z-debug.log
By the way, I went to package.json and changed the dependency version of sharp to 'sharp#0.22.1'. It was previously sharp#0.26.1!
Any leads?
EDIT
Ran ' npm install --verbose sharp'
1 Error(s)
Time Elapsed 00:00:11.67
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\ipche\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ipche\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"
"rebuild"
gyp ERR! cwd C:\Users\ipche\gatsby-strapi-starter\node_modules\sharp
gyp ERR! node -v v14.13.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm verb lifecycle sharp#0.22.1~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp#0.22.1~install: PATH: C:\Users\ipche\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\ipche\gatsby-strapi-starter\node_modules\sharp\node_modules\.bin;C:\Users\ipche\gatsby-strapi-starter\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python38\Scripts\;C:\Python38\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\ipche\anaconda3;C:\Users\ipche\anaconda3\Library\mingw-w64\bin;C:\Users\ipche\anaconda3\Library\usr\bin;C:\Users\ipche\anaconda3\Library\bin;C:\Users\ipche\anaconda3\Scripts;C:\Users\ipche\AppData\Local\Microsoft\WindowsApps;C:\Users\ipche\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\ipche\AppData\Local\GitHubDesktop\bin;C:\Panda3D-1.10.6-x64\python;C:\Panda3D-1.10.6-x64\python\Scripts;C:\Panda3D-1.10.6-x64\bin;C:\Users\ipche\Documents\GitHub\feelDetection\Panda3D-1.10.6-x64\python;C:\Users\ipche\Documents\GitHub\feelDetection\Panda3D-1.10.6-x64\python\Scripts;C:\Users\ipche\Documents\GitHub\feelDetection\Panda3D-1.10.6-x64\bin;C:\Users\ipche\AppData\Roaming\npm
npm verb lifecycle sharp#0.22.1~install: CWD: C:\Users\ipche\gatsby-strapi-starter\node_modules\sharp
npm info lifecycle sharp#0.22.1~install: Failed to exec install script
npm timing action:install Completed in 15700ms
npm verb unlock done using C:\Users\ipche\AppData\Roaming\npm-cache\_locks\staging-4a5f00369a03df36.lock for C:\Users\ipche\gatsby-strapi-starter\node_modules\.staging
npm timing stage:rollbackFailedOptional Completed in 250ms
npm timing stage:runTopLevelLifecycles Completed in 39766ms
Delete the node_module folder first and then try out the below-given methods! This works for me
Update the version of the sharp package manually in the package.json file and then try to run the command npm i sharp
or first, install sharp package and then run the command npm install
In Windows, you may need extra dependencies to make the sharp module work. Try running:
npm install --global windows-build-tools --vs2015
Upon installing this package, it downloads and installs Visual C++ Build Tools 2015, 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.
Check Gatsby on Windows docs for further information.
On my Windows machine another possible solution is to update all the related gatsby plugins (for images).
I did it with yarn, of course, as suggested delete the node modules beforehand.
yarn upgrade-interactive --latest
Pick the onces you need, hope that solves the errors.
The problem could be anything but what worked for me was downgrading my nodejs version, specifically to 14.15.0 using nvm.
steps to follow :
Downgrade nodejs version.
Delete any package-lock.json or yarn-lock.json from the root folder.
Delete node_modules folder.
Delete .cache folder.
Run npm install or yarn install.
Hopefully, it will fix the issue, if it doesn't you can refer to the issues page of the library and more specifically on this issue
I have installed the atom-beautify packages and I received this notify:
gyp info it worked if it ends with ok
gyp info using node-gyp#3.4.0
gyp info using node#6.9.5 | win32 | x64
gyp http GET https://atom.io/download/electron/v2.0.5/iojs-v2.0.5.tar.gz
gyp http 200 https://atom.io/download/electron/v2.0.5/iojs-v2.0.5.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! install error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:1022:11)
gyp ERR! stack at TLSWrap.onread (net.js:569:26)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Users\\Quy Nguyen\\AppData\\Local\\atom\\app-1.30.0\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\Quy Nguyen\\AppData\\Local\\atom\\app-1.30.0\\resources\\app\\apm\\node_modules\\node-gyp\\bin\\node-gyp.js" "install" "--runtime=electron" "--target=2.0.5" "--dist-url=https://atom.io/download/electron" "--arch=x64" "--ensure"
gyp ERR! cwd C:\Users\Quy Nguyen\.atom
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
But sometimes I have different output like that:
npm WARN deprecated graceful-fs#2.0.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
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 minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated #types/commander#2.12.2: This is a stub types definition for commander (https://github.com/tj/commander.js). commander provides its own type definitions, so you don't need #types/commander installed!
npm WARN deprecated jscs-preset-wikimedia#1.0.1: Deprecated in favour of eslint-config-wikimedia. -- https://phabricator.wikimedia.org/T118941
npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "C:\\Users\\Quy Nguyen\\AppData\\Local\\atom\\app-1.30.0\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\Quy Nguyen\\AppData\\Local\\atom\\app-1.30.0\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\Quy Nguyen\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\Quy Nguyen\\.atom\\.apmrc" "install" "C:\\Users\\QUYNGU~1\\AppData\\Local\\Temp\\d-11882-10676-1pd8cj3.buptceg66r\\package.tgz" "--runtime=electron" "--target=2.0.5" "--arch=x64" "--global-style" "--msvs_version=2015"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code EREADFILE
npm ERR! Error extracting C:\Users\Quy Nguyen\.atom\.apm\marko\4.13.3\package.tgz archive: ENOENT: no such file or directory, open 'C:\Users\Quy Nguyen\.atom\.apm\marko\4.13.3\package.tgz'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\QUYNGU~1\AppData\Local\Temp\apm-install-dir-11882-10676-1ak13y1.o2hmklz0k9\npm-debug.log
I cannot understand how it works.
Thanks for your helps!
I am using windows 10 64 bit. I almost ripped my head of falling install atom-beautify. I was receiving "npm ERR! zlib: unexpected end of file". I tried everything. At last I reinstalled atom then deleted the .apm file and finally was able to install atom-beautify package. Hope this information help someone.
On Linux/Mac, the issue is solved by taking the following steps:
Open terminal (Ctrl+Alt+T)
cd /home/your_username/.atom/.apm/marko
ln -s 4.13.4 4.13.3
apm install atom-beautify
On Windows, you can use Git Bash and taking the above steps.
Or, on Windows taking the following steps:
Open cmd/powershell
cd C:\Users\your_username\.atom\.apm\marko
mklink /J 4.13.3 4.13.4
apm install atom-beautify
After deleting the .apm folder I was able to install the atom-beautify package.
Yes this Works!
For MAC/LINUX:
Open terminal
cd /home/your_username/.atom/.apm/marko
ln -s 4.13.4 4.13.3
apm install atom-beautify
For WINDOWS :
Open cmd/powershell
cd C:\Users\your_username\.atom\.apm\marko
mklink /J 4.13.3 4.13.4
apm install atom-beautify
Turning off the Windows firewall and antivirus worked for me.
I've been trying to fix this error for 2 days now. All I did to get the error was:
create-react-app appname
cd appname
npm install firebase --save (and that's the part that failed to install correctly)
These are the major fixes I've tried:
Installed latest version of Python 3 and added it to the windows path variable.
Manually downloaded grpc and added it to the project.
Updated Node to v10+.
I also tried other minor things not worth mentioning, but it didn't make a difference. None of them worked. I tried with multiple clean react apps so react wasn't the issue either.
C:\Users\Future\Desktop\react-turbo>npm i firebase --save
> grpc#1.10.1 install C:\Users\Future\Desktop\react-turbo\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.10.1 and node#10.0.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\Future\AppData\Local\Programs\Python\Python36-32\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:149:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\Future\\Desktop\\react-turbo\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\\Users\\Future\\Desktop\\react-turbo\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown"
gyp ERR! cwd C:\Users\Future\Desktop\react-turbo\node_modules\grpc
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\Future\Desktop\react-turbo\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Future\Desktop\react-turbo\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Future\Desktop\react-turbo\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:947:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Future\\Desktop\\react-turbo\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\Future\Desktop\react-turbo\node_modules\grpc
node-pre-gyp ERR! node -v v10.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\Future\Desktop\react-turbo\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Future\Desktop\react-turbo\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.10.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\Future\AppData\Roaming\npm-cache\_logs\2018-05-07T15_01_00_277Z-debug.log
I will recommend that instead of installing node latest version (which might not be well supported by all libraries) try to use the v8.11 stable version.
Then there are couple of actions/trick to handle this thing:
You might be using Windows 10, so try to disable your antivirus and then try again. If on Linux try to use command sudo in start.
Check this as well: unable to install firebase tools cli using windows 10
And this: Error with npm install - a pre-gyp error
Additional Information
In reference to learning Firebase these might help you as well:
https://medium.com/quick-code/how-to-integrate-react-redux-and-firebase-in-3-simple-steps-c44804a6af38
https://www.codementor.io/yurio/all-you-need-is-react-firebase-4v7g9p4kf
I needed to downgrade node from 10.12 to 8.11
node -v
v10.12.0
npm install -g n
n 8.11.1
mode -v
v8.11.1
I don't know if this is relevant, but I was also getting similar errors.
I was trying to do install the firebase using expo (as recommended in the docs)
expo install firebase
and this was failing for me. I noticed that the issue was related to my package-lock.json where node-pre-gyp was getting added. Wasted some time, but finally the issue was resolved when I did a npm install (and not expo install)
Hope this helps people in the future.
npm install firebase --save
C:\SARANRAJ-K.R\Medrec\meds_6.2.0_update7>npm install
npm WARN deprecated express3-handlebars#0.5.2: THIS PACKAGE HAS BEEN RENAMED TO:
npm WARN deprecated grunt-ngmin#0.0.3: use grunt-ng-annotate instead
npm WARN deprecated phantomjs#2.1.7: Package renamed to phantomjs-prebuilt. Plea
npm WARN deprecated tough-cookie#0.12.1: ReDoS vulnerability parsing Set-Cookie
npm WARN deprecated ngmin#0.4.1: use ng-annotate instead
npm WARN deprecated tough-cookie#0.9.15: ReDoS vulnerability parsing Set-Cookie
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie h
npm WARN deprecated deflate-crc32-stream#0.1.2: module has been merged into crc3
npm ERR! code 128
npm ERR! Command failed: C:\Program Files\Git\cmd\git.EXE checkout 74fd92dc48f95
npm ERR! fatal: reference is not a tree: 74fd92dc48f9575abc701fbd84decad160c5cc6
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\gd14980\AppData\Roaming\npm-cache\_logs\2017-06-20T05_55_0
I got above error while run npm install command
Try using this command.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/8.0/bin/node /usr/bin/node
I did also faced similar issue while running "npm run bootstrap" and below is the error
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q git://github.com/rehooks/window-scroll-position.git /root/.npm/_cacache/tmp/git-clone-ab3c3294/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-ab3c3294/.git'
npm ERR!
But below is the solution as it was the issue due to node version.
I previously using below versions due to which it was failing,
npm --version
6.10.2
[Pipeline] sh
node --version
v12.9.1
which I changed to,
npm --version
6.10.2
[Pipeline] sh
+ node --version
v12.9.1
and it started working...;)