webpack-cli : Error: spawn Unknown system error -86 / Symfony - npm

I have just acquired a new mac with M1 chip and I wonder if the error is related to this, because on my old one I have no problem.
[webpack-cli] Error: spawn Unknown system error -86
at ChildProcess.spawn (node:internal/child_process:412:11)
at spawn (node:child_process:698:9)
at Object.execFile (node:child_process:325:17)
at Object.module.exports.fileCommandJson (/Users/mlc/Sites/ImapImport/node_modules/node-notifier/lib/utils.js:88:13)
at NotificationCenter.notifyRaw (/Users/mlc/Sites/ImapImport/node_modules/node-notifier/notifiers/notificationcenter.js:81:11)
at WebpackNotifierPlugin.compilationDone (/Users/mlc/Sites/ImapImport/node_modules/webpack-notifier/index.js:129:14)
at Hook.eval [as callAsync] (eval at create (/Users/mlc/Sites/ImapImport/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/mlc/Sites/ImapImport/node_modules/tapable/lib/Hook.js:18:14)
at /Users/mlc/Sites/ImapImport/node_modules/webpack/lib/Compiler.js:498:23
at Compiler.emitRecords (/Users/mlc/Sites/ImapImport/node_modules/webpack/lib/Compiler.js:906:5) {
errno: -86,
code: 'Unknown system error -86',
syscall: 'spawn'
}
It occurs when the command is launched:
npm run dev
or
yarn encore dev
I have already tried deleting the node_modules file as well as the package-lock.json, and clearing the npm cache then re-running npm install but nothing worked.
Suggestions ?

Today I got my new M1 Pro as well and I had the same issue. The interesting thing is that the npm run prod created all files correctly.
First I checked if xcode-select --install is installed - it was.
Next I checked the installed git version git --version -> git version 2.32.0 (Apple Git-132), standard Apple git. I installed a fresh git via homebrew brew install git and restarted my Mac. After that the error was gone.
If this does not fix your error, maybe it is an weird npm package.

Problem solved, thanks to #andreasm for pointing me in the right direction.
I explain myself after checking on xcode was installed with the command :
xcode-select -p
it was, so I did not carry more attention than that, today just out of curiosity by executing :
xcode-select --install
the error has disappeared, morality: Do not trust the first command.

Related

zsh: command not found: heroku, after installing through npm

I am trying to install the heroku-cli
I am on mac and I am using npm to install it.
npm install -g heroku
After installing I run the command heroku and the response I receive is:
zsh: command not found: heroku
I have been searching the internet for an answer for way too long now and can not seem to resolve this issue..
I have also downloaded the macOs tarbells and when I open the file, navigate to the bin folder and open the file "heroku" it opens my terminal and display this message.
Even after what looks like it has successfully been installed, when I type heroku --version I still get the command not found.
I am not the most experienced in this field. The reason I am trying to download heroku is because I am doing Fullstack Open.
I just hope it is an easy fix and someone more experienced than me can guide me in the right direction.
I should add I have tried uninstalling and reinstalling multiple times.
SOLUTION FOUND: The solution that helped me was installing homebrew and after installing I ran the command:
brew tap heroku/brew && brew install heroku
heroku command not
npm i -g heroku
zsh: command not found npm:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh
zsh: command not
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH

Error "Cannot read property "matches" of undefined" when using "npm install"

I'm trying to install expo globally on my Windows 10 machine for a school assignement.
As the doc says, I've been trying the following command in my terminal :
$ npm install --global expo-cli
but it always gives me the same error :
npm ERR! Cannot read property 'matches' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2021-04-07T13_43_16_562Z-debug.log
I've tried running $ npm install -g expo-cli instead but the same thing happens.
I haven't tried reinstalling node or anything yet because I need my pc up and running for this week and I'm not too accustomed to all that, I'd like to keep that a last resort if possible.
Has anyone ever encountered this error before ?
Thanks to those who replied but I "accidentally" fixed it myself.
Through my searching I ended up actually uninstalling node with $ nvm uninstall v15.0.0 and I found myself obligated to download it again here.
Must've been a problem with the version I was using as suggested before.
Try removing the node_modules folder and package-lock.json file and run command npm install.

NPM Error: EPERM: operation not permitted. Tarball data for <package> seems to be corrupted

I've been trying to create a new angular app with the cli, but I keep getting this error.
At first I thought it was something related to the version of cli I had installed( the latest one), so I uninstalled it and tried with the same version(6.0.8) that is used in the course I'm following along, but I get the same error :
Do you have any idea how I can figure out what is causing this issue?
Is there any log I can check?
I'm using :
Node: v8.11.3
Npm: 6.4.1
Windows 10 Pro.
I resolved it using this command:
npm install --registry https://registry.cnpmjs.org

npm - tarball data for material-design-icons seems to be corrupted

I'm having this error while running a npm install material-design-icons#3.0.1:
tarball data for material-design-icons#3.0.1 (sha1-mnHEh0chjrylHlGmbaaCA4zct78=) seems to be corrupted
npm ERR! path D:\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png'
npm ERR! { Error: EPERM: operation not permitted, unlink 'D:\\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png'
Here it's documented as a bug, but still without an answer nor a fix.
I've tried to reinstall node, upgraded to latest npm version (currently running 6.4.1), did a cache clean --force, tried a npm install --no-optional, removed package-lock.json, removed npm & npm-cache folders from AppData directory, running everything as Administrator, but still no luck.
I even tried with material-design-icons#3.0.0 but the error remains.
If I navigate to the folder that appears in the log (node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi), it's empty, and is the only folder that exists in the entire node_modules directory. I can delete that dir without any problems, so it does not seem to be a permissions/lock issue.
Any suggestions?
Finally, I got this fixed by:
Removing node_modules folder
Running npm update
Running npm install
As far I understand, the npm update should have updated the package.json file, but all dependencies kept the same versions as we had it before.
I resolved this with the command: npm cache verify which output:
Cache verified and compressed (C:\Programs\DCPS\npm-cache\_cacache):
Content verified: 1344 (164824963 bytes)
Content garbage-collected: 1 (3491551 bytes)
Index entries: 1522
Finished in 8.187s
The line that stands out to me is: Content garbage-collected: 1 (3491551 bytes)
Does this sort of thing happen because a new version of a package is published to npmjs without a version bump?
No need to run npm update (I didn't want to update any packages) or delete the entire node_modules folder. I solved this by
deleting package-lock.json
deleting node_modules\material-design-icons-xxxxxxx
running npm install again
If npm update is not a solution, and as deleting package-lock.json can bring issues of its own, I could solve it simply by:
deleting the node_modules/ folder
in package-lock.json, deleting the sections referencing to the corrupted package
running npm install again
If you are on windows env, I fixed it by running the cmd as administrator
You need to confirm whether the Typescript is installed and after installing typescript it worked for me
running the below comment will show the typescript version
tsc -v
If it shows some error install the typescript
npm install -g typescript
If then typescript is installed you can try checking the Angular Cli version
ng --version
If it shows some error then install Angular Cli Ref: https://cli.angular.io/
npm install -g #angular/cli
" If you are on windows env, I fixed it by running the cmd as administrator "
This worked for me. However, chromedriver was not installed. So, i installed it separately using the command 'npm install chromedriver'.
None of the answers solved my problem, because in my case was the git. Maybe someone can have the same problem.
I had some dependencies from git in the project and my git was not working on the terminal. So fixing the path for git fixed it!
I had this in Bitbucket Pipeline when using a private package.
I was missing to install git in pipeline:
script:
- apk update && apk upgrade && apk add --no-cache bash git openssh # <- THIS
- npm ci --prefer-offline
Dependency was
"some-private-package": "git+ssh://git#bitbucket.org/workspace/some-private-package#v1.0.12",`
Well I could not resolve this problem with a lot of tries so I made the download of the github ZIP, unzip and install and it worked !
download material-design-icons from github
unzip to the directory of your project (or c:\tmp)
npm install ./material-design-icons
or
npm install c:/tmp/material-design-icons

npm install error - cb() never called

I try to install node_module in my angular project what I downloaded, but I get this error:
npm ERR! registry error parsing json
Then i reinstall npm using npm intall npm -g and after when i try use npm install I get this error:
(node:11252) UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): Error: ENOENT: no such file or directory, stat
'C:\Users\User\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-ec5da46c\angular\cdk.es5.js'
debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#5.4.2
3 info using node#v6.10.2
4 verbose npm-session ff5ce249dfe37f0e
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall spa#0.0.0
7 info lifecycle spa#0.0.0~preinstall: spa#0.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 info lifecycle #angular/cdk#2.0.0-beta.10-a7ce31e~prepack: #angular/cdk#2.0.0-beta.10-a7ce31e
14 error cb() never called!
15 error This is an error with npm itself. Please report this error at:
16 error <https://github.com/npm/npm/issues>
I already tried npm cache clean --force but i get same error.
node -v v6.10.2
npm -v 5.4.2
I had the same issue. I resolved it
by excluding package-lock.json file
npm i --no-package-lock
OR by manually deleting package-lock.json
Run npm cache clean --force and perform an install.
I had the same issue. I resolved it by remove nodejs#10 and install nodejs#8
On Windows 10 running npm install gave me this error.
I solved this issue by doing so from within Administrator: Command Prompt.
Ensure that you have a package.json file within the root of your angular project which should look something similar to this.
https://github.com/heroku/node-js-sample/blob/master/package.json
If the package.json file exists, you run npm install to get the packages saved to it and that will generate a node_modules directory for you.
However, if the file does not exist, it means you have to initialize npm into the project by running npm i -y which should automatically create a package.json file for you and as well allow you to install node modules.
NB: You have npm installed on your machine already so running npm install npm -g is not ideal.
I got this error when my package.json referred to a package using file:../(local path) and the directory didn't exist. Pointing it to the correct path resolved the error.
In my case... none of the above worked. I then deleted my package-lock.json. When I ran an npm install I got an error that a certain package could not be found in the repository. When I removed that from package.json my npm install worked!
I had the same issue. In my case it was caused by a syntax error within the .npmrc file, which was manually edited
Method 1:
npm cache clean --force then install your package
Method 2:
Disable your antivirus software and try to install your package
Method 3:
It is your internet connection, if you are using Wifi or an Ethernet connection use your cellular network or a different network and try to install your package