Whenever I run npm install in my terminal, I get "cb() never called" - npm-install

npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\JOVANNE DELA ROSA\AppData\Roaming\npm-cache\_logs\2021-07-16T20_58_48_839Z-debug.log

When we install a node packages from package.json file and package-lock.json file is corrupted due to some reasons like node.js version is updated to the latest, we will see an error like this in our terminal.
To fix this error, first delete the package-lock.json file and run the following command.
npm cache clean --force
Now, try to install your packages using the npm install command.

Related

Got errs with puppeteer and node-sass running npm i

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

npm ERR! code ENOLOCAL while running npm install

I am facing the error below, I tried clear the cache and install npm latest but all are no use to me, may I know is there any way to resolve it?
> npm install
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\tui-editor\squire-rte#github:seonim-ryu\Squire#fd40b4e3020845825701e9689f190bab3f4775d4" as it does not contain a package.json file.
you should try to delete node modules folder repeatedly and reinstall packages by npm install command
npm cache clean try this command after deleted node modules

how to solve error code 1 when running npm

I am using Visual Studio Code on MacOS latest version.
I am getting many errors when I try to run npm start that I have posted in a separate question here:
unable to solve error code 1 when running"npm install"
I thought to install all possible modules again to solve the issue when I try to run:
npm i -g npm
I even get errors that part of that is copied here:
ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/lib/node_modules/node/bin/node
/usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --
cache=/Users/afshinshahpari/.npm --prefer-offline=false --prefer-online=false --
offline=false --no-progress --no-save --no-audit --include=dev --include=peer --
include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile The package-lock.json file was created with an old
version of npm,
npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the
registry.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
npm ERR! npm WARN old lockfile
npm ERR! npm WARN deprecated fsevents#1.2.11: fsevents 1 will break on node v14+ and
could be using insecure binaries. Upgrade to fsevents 2.
I tried to fix the issue using this article:
npm ERR! git dep preparation failed when trying to install package.json
but when running "npm audit fix" i get a new set of errors:
npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/afshinshahpari/.npm/_logs/2021-08-16T12_46_15_639Z-debug.log
in order to solve it, I used
npm i --package-lock-only
but no success.
Here's the solution bro try this.
Step 1:
$ npm cache clean --force
Step 2
Delete node_modules by
$ rm -rf node_modules package-lock.json folder
or delete it manually by going into the directory and right-click > delete / move to trash. Also, delete package-lock.json file too.
Step 3
npm install
To start again,
$ npm start
This worked for me. Hopes it works for you too.
PS: If it is still there, kindly check the error it is displaying in red and act accordingly. This error is specific to Node.js environment.

Private modules npm install error

After npm install in project local directory I've got log with error like this
npm ERR! code ENOLOCAL
npm ERR! Could not install from "..{path}" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/home/.npm/_logs/2018-06-28T11_13_56_437Z-debug.log
How I can resolve this problem? (the best way without deleting node-modules)

Can't install "react native cli" globally by using git bash

When I type in "npm install -g react-native-cli" at git bash I get following errors:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at: npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\TOSHIBA İ5\AppData\Roaming\npm-cache_logs\2017-10-19T04_04_05_774Z-debug.log
I have already installed npm and added it's directory to PATH variable and when i type "which npm" at git bash it shows the directory so there is no problem about the installation of npm. But it still gives these errors and I am stuck.
Note: I am following the instructions on https://shift.infinite.red/getting-started-with-react-native-development-on-windows-90d85a72ae65
This could happen in some npm old versions. Make sure you are using an updated one.
npm install -g npm
Some linux distros have old versions of npm and node on their packages and you need to install it manually.
Edit: I just saw you have windows. Nevermind, still the old version could be a problem.