unable to install any packages on atom. The error is
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/yaoli/.atom/.apm/_logs/2020-02-17T09_39_31_164Z-debug.log
I have tried to clean the npm cached and reinstall npm. It didn't work.
I resolved this by deleting the contents of ~/.atom/.apm and then reinstalling the package through the atom gui.
~/.atom/.apm$ rm -rf *
Related
I have a double problem.
The work environment is in Vue and Nuxt, with a mac M1 pro.
Until last week, I had no problems, everything was running perfect. They changed my mac and the world stopped running.
I download 2 repos, but when running npm i, one explodes with puppeteer and the other with node-sass.
npm ERR! code ELIFECYCLE npm ERR! error 1 npm ERR! puppeteer#8.0.0 install:nodeinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the puppeteer#8.0.0 install script.
npm ERR! code ELIFECYCLE npm ERR! error 1 npm ERR! node-sass#4.14.1 postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass#4.14.1 postinstall script.
I am using the correct version of Node.
I tried deleting the package-lock.json and the node_modules, clearing the npm cache, and running npm i again, and no, it breaks.
I tried installing those specific packages outside of npm i, and I get the same error.
I tried creating a .npmrc file with
registry=https://registry.npmjs.org always-auth=true //registry.npmjs.org/: "token"
I am using the same package.json and the same repos as my peers. They also have mac M1 and have no problem.
On Github we have the same permissions.
Any idea what is happening?
Thank you very much in advance \o/
You can use sass instead of node-sass. This is because node-sass has been deprecated.
npm uninstall node-sass
npm install sass
Works all the same, no need to make any other changes
I would like to update to the latest npm version on a mac, so of course I ran
npm install -g npm#latest
but I got the following error message
rm not removing /usr/local/bin/npm as it wasn't installed by /usr/local/lib/node_modules/npm
npm WARN rm not removing /usr/local/bin/npx as it wasn't installed by /usr/local/lib/node_modules/npm
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/npm/bin/npx-cli.js
npm ERR! dest /usr/local/bin/npx
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/npm/bin/npx-cli.js' -> '/usr/local/bin/npx'
npm ERR! File exists: /usr/local/bin/npx
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
Ok, I would like to not run --force to overwrite files recklessly - so how do I get npm to install the latest version in this case?
My create-react-app not working when I run the following command:
npm install create-react-app -g
Here is the output I get:
npm ERR! code EEXIST
npm ERR! path C:\Users\Raisa IT\AppData\Roaming\npm\node_modules\create-react-app\index.js
npm ERR! dest C:\Users\Raisa IT\AppData\Roaming\npm\create-react-app.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\Raisa IT\AppData\Roaming\npm\node_modules\create-react-app\index.js' -> 'C:\Users\Raisa IT\AppData\Roaming\npm\create-react-app.cmd'
npm ERR! File exists: C:\Users\Raisa IT\AppData\Roaming\npm\create-react-app.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Raisa IT\AppData\Roaming\npm-cache\_logs\2021-01-06T13_18_41_018Z-debug.log
How would I go about solving this issue?
This error is saying that create-react-app already exists. Try running create-react-app.
Im trying to install gulp-sass from terminal window in visual studio code.
other dependencies like autoprefixer, concat etc install without a problem, but gulp-sass keeps giving me this error.
> node-sass#4.9.0 install /usr/local/lib/node_modules/node-sass
> node scripts/install.js
sh: node: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! node-sass#4.9.0 install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Im running VSC on a mac.
Any help please? I am completely new at all this btw, no programming background, just front end dev.
Thanks a lot
I have the same problem. And I found this solution:
sudo npm install -g node-sass#4.5.3 --unsafe-perm = true --allow-root
I just changed part of the code:
sudo npm install gulp-sass --unsafe-perm = true --allow-root
It worked for me.
[npm install -g node-sass#4.5.3 --unsafe-perm=true --allow-root]
This one did work for me to install the package but it failed again when I start the application
I tried with the [yarn install] instead of [npm install]
The app started successfully.
I get the same solution as you. and I tried searching on the internet and I found here http://relaxitblog.com/?p=611
then after that I installed: sudo npm install gulp-sass
after that: npm audit fix
success
I am starting with Electron js and I have stumbled on the very first step which is installed Electron.
I am running the following command to install electron provided at
source
npm install electron-prebuilt --save-dev
Following is the result of the command
C:\Users\vikas\Desktop\electron apps\example>npm install electron-prebuilt --sa
ve-dev
electron-prebuilt#0.37.8 postinstall C:\Users\vikas\Desktop\electron apps\exa
mple\node_modules\electron-prebuilt
node install.js
C:\Users\vikas\Desktop\electron apps\example\node_modules\electron-prebuilt\ins
tall.js:22
throw err
^
Error: end of central directory record signature not found
at C:\Users\vikas\Desktop\electron apps\example\node_modules\yauzl\index.js
:167:14
at C:\Users\vikas\Desktop\electron apps\example\node_modules\yauzl\index.js
:473:5
at C:\Users\vikas\Desktop\electron apps\example\node_modules\fd-slicer\inde
x.js:32:7
at FSReqWrap.wrapper as oncomplete
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\vikas\Desktop
\electron apps\example\package.json'
npm WARN example No description
npm WARN example No repository field.
npm WARN example No README data
npm WARN example No license field.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\vikas\AppData\
\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "electron-prebuilt"
"--save-dev"
npm ERR! node v4.4.3
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! electron-prebuilt#0.37.8 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-prebuilt#0.37.8 postinstall script 'node install
.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-prebuilt pac
kage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\vikas\Desktop\electron apps\example\npm-debug.log
Windows 8.1
NPM Version 3.8.9
Does C:\Users\vikas\Desktop\electron apps\example\package.json exist? If not try running npm init to create it, and then run npm install electron-prebuilt --save-dev again.
this is bug and a workaround is provided on github : Source
Here is the workaround:
rm -rf ~/.electron/
rm -rf ~/.atom/
npm cache clear
npm install
I was facing a similar issue. But opening the command prompt as administrator (Windows) and reinstalling electron fixed the issue.