npm error while installing ionic dependencies - ionic-framework

After cloning the project code from the Repository, I'm trying to install the npm to update the packages and plugins included. The command used is:
npm install
It worked well for previous clones. But now it displays the following error:
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN appname# No repository field.
npm WARN appname# No license field.
When I tried to install fsevents using --verbose, it is said that the supported OS is Darwin. But it worked in the previous clone. Why not now?

If your a Windows user:
The fsevents warning isn't a problem. It's an optional dependency and isn't needed for this to work on Windows.
But the error still displaying, in order to fix this.
Open package.json and delete the gulp-watch dependecy
Manualy remove the folder (gulp-watch) from the node_modules fordel
Unload the Project and uploaded again
The error is gone!!!
There's a issue open to fix this in .net core , but this will work untill then.

Related

npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher

I am getting this warning from github on my npm project build process...
I tried searching on the internet and also read the blog link posted by github - but I could not find the solution to it anywhere. Am I missing something ?
Warning seen
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
After updating your NodeJS and NPM Version run this command in CLI
npm set registry=https://registry.npmjs.org/
Save your Life, Thanks me Later :D
I can solve the issue by the way:
First Step: npm set registry=https://registry.npmjs.org/
Second Step: npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
Besides updating your version of node to an active or current LTS you want to ensure your NPM registry is set to an HTTPS endpoint:
registry=https://registry.npmjs.org/
You are facing that issue because your registry is set to HTTP version which is a bit insecure so the first thing that you should do is to put it to HTTPS version by running the following command below
npm set registry=https://registry.npmjs.org/
Then, after that you have to make sure your version of npm supports TLS 1.2, you can install a test package from an HTTPS endpoint that already has TLS 1.0 and TLS 1.1 disabled: by running this command below
npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
You should see the following message:
Hello! The tls-test package was successfully downloaded and installed. Congratulations! Your package manager appears to support TLS 1.2.
If you don't see the message, don't worry you can try to install the package again, hope it will work out for you
Please make sure that you have latest(or somewhat recent) version of node installed on your system
To make sure that your version of npm supports TLS 1.2, you can install a test package from an HTTPS endpoint that already has TLS 1.0 and TLS 1.1 disabled:
npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
You should see the following message:
Hello! The tls-test package was successfully downloaded and installed.
Congratulations! Your package manager appears to support TLS 1.2.
If you didn't see the above message, try to install some npm package.
If you didn't see the npm notice, you're good to go. If you happened to see again, please run the below command too.
npm set registry=https://registry.npmjs.org/
Source: The npm registry is deprecating TLS 1.0 and TLS 1.1
You are facing this issue because of your registry is still set to http version and that causing you this error. All You need to do is just Run following command in your terminal.
npm config set registry https://registry.npmjs.org/
and that is it!
now you can run any npm command
Well, I had several problems with node and npm. The one described in this question was only the last one.
I was not able to execute npm install, the node_modules were partially downloaded and at the end of the execution they were all deleted (the folder was visible, but it was deleted after running the command).
First problem: --location=global
First, I was getting this error message:
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead
Which I solved by following these instructions: https://stackoverflow.com/a/72592742/7389293
Apparently that allowed me to update to:
node -v: c16.16.0
npm -v: 8.17.0
Today's date: August 13, 2022.
Second problem: use TLS 1.2 or higher
Then, I still was having the error described in this question, which didn't allowed me to install the node_modules folder in my project:
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher
The selected answer to the question made in the present screen your reading, finally fixed the problem: https://stackoverflow.com/a/70555822/7389293
After all of this I was able to run npm again, install all the packages from the package.json file, and run the website normally in the browser.
maxtimeout didn't work for me
so I tried converting to yarn by npm I -g yarn
and then yarn install in the root directory of the project(where I have to install the node_modules)

How to fix 'Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

Testing binary
Binary is fine
npm WARN rollback Rolling back node-pre-gyp#0.12.0 failed (this is probably harmless):
EPERM: operation not permitted, lstat 'C:\Users\orca
yoon\Documents\IonicProjects\starters\epic\node_modules\fsevents\node_modules'
npm notice created a lockfile as package-lock.json. You should commit
this file.
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"})
added 1105 packages from 1050 contributors and audited 53269 packages in 445.94s
found 1 high severity vulnerability
run npm audit fix to fix them, or npm audit for details
First,
Run your command prompt or powershell as Administrator role. Then you'll get avoided with PERMISSION ERROR.
Second,
Ignore npm audit fix. It only suggests you to renovate all of your package.json dependencies up-to-date. You should preserve the settings clarified in package.json.
Third,
If you're working on ubuntu or OS X, you won't face this issue, I guess.
PS:
According to your reply, I'd like to think about the workaround.
Remove the local node_modules & package-lock.json
Clean npm cache by npm cache verify
Update the global npm by sudo npm i -g npm
Reinstall the local node_modules by npm i
Hope this might help.
I found a solution, this is what I did:
Open your package-lock.json.
Find node_modules/fsevents, inside this there is something called "os", I had only this:
"os": [
"darwin",
],
So my OS is windows 10 64 bits I just added my OS inside "os", the result is this:
"os": [
"darwin",
"win32"
],
then save and is solved, after doing this I could install the package I was trying to install that I couldn't.
As I got into the issue just today I read the first solution but tried one thing first
Remove package-lock.json and node_modules dir first
Run these commands and it should work.
rm -rf node_modules package-lock.json
npm install
worked like a charm maybe it'll help someone else.
When seeing this kind of message on ionic or anywhere else, do run npm audit fix and see if you can successfully follow the given advice to resolve all "high severity vulnerability" issues and contribute the resulting updated dependencies back to the given codebase.
What's happening here is that a package called chokidar is being used to "watch" filesystem directories for "events" (like files being added). chokidar is a wrapper for Linux-, Windows-, and Mac-specific filesystem-watching packages, of which fsevents is the Mac variant. So, I am pretty sure anything that uses chokidar is going to have fsevents as an optional dependency, but as others have said, this WARN message can be safely ignored, as chokidar supports all common desktop architectures.
If like me, you got this issue because of using two different package managers at the same time (E.g. yarn and npm), you can simply remove the lockfile and rerun your package manager.
rm package-lock.json
The lockfile will be regenerated the next time you run your package manager. I got this error while trying to upgrade the packages with npm upgrade. After deleting the lockfile, upgrade proceeded smoothly and the lockfile was created correctly.
This warning will appear if you added IOS as platform to your project and run npm i on Windows or Linux. As you can't build IOS packages on these systems anyway you can safely ignore this warning.
I had the same issue:
Deleted package-lock.json
npm install
viola, it worked for me
After opening the command prompt or PowerShell in the administrator mode, what helped me was following this answer here.
I ran the command:
npm i --force
and that seemed to fix the issue.
If you're seeing this error in a node Github workflow, you can update the runs-on value in node.js.yml to macos-latest and it will work. Worked for me anyways.
The critical breakthrough for me was actually simple:
yarn remove fsevents
I verified that it worked by ctrl + f in yarn.lock for 'fsevents'. Before removing it, it appeared 9 times, after removing it, only 8. So I knew it had some effect.
Extra info
After removing fsevents:
git add .
git commit -m "Removed fsevents"
git push heroku master
and it worked.
Note that I also had to run bin/webpack-dev-server to see if the assets would precompile (better to try this locally where you can quickly address any deficiencies, rather than on heroku where it will take time to build).
I fixed any missing libraries with something like yarn add '#rails/activestorage' '#rails/ujs' etc, and when the app went to heroku it worked.
You have to add win64 on package.json file
For example
{"os":"darwin,linux","arch":"any"} will replace with
{"os":"darwin,linux,win32,win64","arch":"any"}

vscode assistance with building cpptools needed

Ubuntu 18.04 ARM64
I have download and built vscode and this appears to be working.
I can see the extension market place and install extensions. The C/C++ IntelliSense, debugging, and code browsing install but gets a dependency install failure sometimes:
Updating C/C++ dependencies...
Downloading package 'Mono Framework Assemblies' (5368 KB) Done!
Installing package 'Mono Framework Assemblies'
Failed at stage: installPackages
Error: end of central directory record signature not found
It seems to succeed on the second attempt but I'm not convinced.
So I have cloned vscode-cpptools and would like to built it myself but I'm not sure what dependencies it has or how to build it correctly.
Any tips appreciated!
So following the build and debug guide at:
$ git clone -b release https://github.com/Microsoft/vscode-cpptools
$ cd vscode-cpptools/Extension
$ npm install ! should install all dependencies but it forgets gulp
$ npm install gulp ! Manually install. I wonder what else it forgets
$ vsce package ! Should trigger the build and make the vsix package.
So the package is created and when I try and install it via the vscode extensions I get
Unable to start the C/C++ language server. IntelliSense features will be disabled. Error: Missing binary at ~/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.22.1/bin/Microsoft.VSCode.CPP.Extension.linux.
Me thinks there are a lot of other dependencies that are missing!!!
Looking in the Extension bin folder and two important binaries are missing:
Microsoft.VSCode.CPP.Extension.linux
Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
I also tried this on Intel Ubuntu 18.04 and while the Intel build appeared to do a whole lot more it also fails to build the binaries.
Found the answer in here : github.com/Microsoft/vscode-cpptools/issues/429 which indicates there is no support for Aaarch64 Arm64 at this point in time.

npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0

I'm using ionic 3 whatsapp clone github project but when i run ionic serve command got this error when i try to install appscripts Error npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
Uninstal Ionic and Cordova:
npm uninstall cordova ionic
Then clean cache:
npm cache clean -f
Then install ionic and cordova again:
npm install -g ionic#3.4.0
npm install -g cordova#7.0.1
Worked for me!
I had the same problem and fixed it by using the following command in the project directory:
npm install
This will install needed packages, so the project can work properly.
See also:
npm deprecated WARN for newly created app #4926
The error itself comes from the package.json file in the browserslist folder in your project.
"deprecated": "Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools."
I'm installing Laravel but get the same error.
I allowed the npm install to go all thr way through and scrolled up. There are some issues present in mine. Will possibly say something like the below.
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 img-loader#3.0.0 requires a peer of imagemin#^5.0.0 but none
is installed. You must install peer dependencies yourself. npm WARN
optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4
(node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:
Unsupported platform for fsevents#1.2.4: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
You can run npm install again if you'd like and this should give you the new errors in a more compact area.
-note: notice the commands below correspond with what is stated after "requires a peer of..."
npm i ajv
npm i imagemin#5.0.0
npm install
Not sure why, but the imagemin wouldn't work unless I specified the version.
At this point I only had one error left
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4
(node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:
Unsupported platform for fsevents#1.2.4: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
I believe this has to do with me being on a windows machine. If you get this error just force it. If anyone has a better solution at this point I'd love to hear it.
npm i -f
You could try a reset.
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
I fixed this issue by putting required binaries in the .bin folder under node_modules folder

How do I fix an error: Unknown plugin "flow-react-proptypes" in react native?

I'm trying to use https://github.com/jacklam718/react-native-action-sheet-component in a react-native project and am getting the following runtime error
Unknown plugin "flow-react-proptypes" specified in
"node_modules/react-native-action-sheet-component/.babelrc.env.development
I tried yarn add babel-plugin-flow-react-proptypes -D but that didn't seem to fix it.
React-native version 0.41.2, iOS
Im not familiar with yarn but from that repo packaje.json we can see that babel-plugin-flow-react-proptypes is listed as devDependency so it won't get installed when installing the package from npm.
Try installing it in your node_modules folder (if that's not what you already did with yarn) or go into node_modules/react-native... And execute npm install.