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

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)

Related

ERROR:The serve command requires to be run in an Angular project, but a project definition could not be found

I am trying to clone the git repository for Tour of Heros with NgRX (blove/ngrx-tour-of-heros)
However, I can not seem to run the application.
I have updated my Angular cli to 7.3 I have installed yarn to try and help as well as tried to create a new application and remove files to drag and drop files that where not there like the node modules, and I am still getting this error.
How do I get this error removed so that I can see the file?
Check your build per-requisites, as illustrated by blove/ngrx-tour-of-heros issue 2
Breaking changes - node => 10
ERROR - "json-server requires at least version 4 of Node, please upgrade"
if your node -v is greater than 10, npm upgrade json-server
Appears that node-sass was optional on yarn install.
Had to install separately - yarn add none-sass
Also, cd client and cd server are reversed in lines 13 and 15.
The angular project is in de client directory, so after cloning the repo you have to get into the client directory before running the ng serve command:
git clone https://github.com/blove/ngrx-tour-of-heros.git
cd ./client
yarn install
npm run start
Seems like it's an older repo with Angular v5 and CLI v 1.6 - try downgrading if it doesn't work. https://github.com/blove/ngrx-tour-of-heros/blob/master/client/package.json#L32

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"}

npm error while installing ionic dependencies

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.

jspm hot reloading install - command not found after global install

i try to install the hot reload module of jspm using the chokidar-socket-emitter. Installation works like charme, but after that it is not possible to start the watch task as described here: http://jspm.io/0.17-beta-guide/hot-reloading.html
Here is my install log:
XXXXXMacBookPro:dasding xxxxxx$ sudo npm i -g chokidar-socket-emitter
\
fsevents#1.0.12 install /usr/local/lib/node_modules/chokidar-socket-emitter/node_modules/chokidar/node_modules/fsevents
node-pre-gyp install --fallback-to-build
[fsevents] Success: "/usr/local/lib/node_modules/chokidar-socket-emitter/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v14-darwin-x64/fse.node" is installed via remote
chokidar-socket-emitter#0.3.1 /usr/local/lib/node_modules/chokidar-socket-emitter
├── socket.io#1.4.6 (has-binary#0.1.7, debug#2.2.0, socket.io-parser#2.2.6, socket.io-adapter#0.4.0, engine.io#1.6.9, socket.io-client#1.4.6)
└── chokidar#1.5.2 (path-is-absolute#1.0.0, inherits#2.0.1, glob-parent#2.0.0, async-each#1.0.0, is-binary-path#1.0.1, is-glob#2.0.1, readdirp#2.0.0, anymatch#1.3.0, fsevents#1.0.12)
XXXXXMacBookPro:dasding xxxxxx$ chokidar-socket-emitter
bash: chokidar-socket-emitter: command not found
XXXXXMacBookPro:dasding xxxxxx$
Does anyone has any idea why he is unable to find the command? i have no idea how to fix this, global installs always used to work without any problem.
thanks in advance
Ok, in case someone faces the same problem - my current node.js installation was unable to handle the latest version of chokidar-socket-emitter, so a lower version was installed, but the docs refered to the latest version, so there never was a command that could have been found. after updating my node.js installation everything worked like charme.

Ionic framework - 'ionic' is not recognized as an internal or external command

I was trying to install ionic and create a sample project on it since morning. But, was facing a series of issues since then. Tried solving them one by one. Atlast restarted my machine and opened command prompt to build the sample project and tried
path of the sample project> ionic build android
But, i kept on facing the error that states 'ionic' is not recognized as an internal or external command.
I tried clearing the cache and reinstalling ionic in my machine. Still, I face the same issue of ionic is not recognized as an internal or external command.
Can somebody help me out on this issue?
Thanks
Manikandan J
Somehow , my npm path was not there in PATH environmental Variable
So after adding C:\Users\XXXXX\AppData\Roaming\npm to my PATH variable my problem solved :-)
Try to install the ionic framework with the -g parameter, so the installation will be globall, like this:
npm install -g ionic
-g parameter mean "its binaries end up in your PATH environment variable."
If you're on Windows 10 (and possibly Vista/8/8.1) you need to run cmd.exe as an administrator. Now when you run the commands below, your environment settings will be made.
npm install -g cordova ionic
Check if the configuration is broken or not. the update might have installed it in the wrong place.
First check: npm config get prefix
In my case It wasn't set to /usr/local but in /usr/Roaming.
So to fix it, use: npm config set prefix
Problem solved! :)
After several hours of struggle I fixed it by the below steps:
uninstall node js restart the system .
install the node js (current version).
check your node js path in System variable in an
environmental variable.
Right click the command prompt and select run as administrator. Type cd\ now get into the npm path folder by cd <YourNpmPath>\npm install -g ionic#4
That's it . Now it is globally available throughout the system.
I ran this command to uninstall:
npm uninstall -g ionic cordova
and then ran the install:
npm install -g ionic cordova
and then everything started working again.
Insert this into your system path. This happens because node modules are not seen but when you do this you make the path to the module. They are found in this location
C:\Users\[username]\AppData\Roaming\npm
Below simple steps to follow to get it working:
install Node.js
Install Ionic and cordova : npm install -g cordova ionic
create a simple project: ionic start mySimpleApp tabs
cd mySimpleApp
ionic cordova platform add android
Build the project: ionic build android
For the benefit of searchers, the other answers didn't work for me.
I deleted the 'Ionic' folder from:
C:\Users\..{me}..\AppData\Roaming\npm\node_modules
Then installed again with:
npm install -g ionic cordova
That fixed it.
I solve the problem on windows 10.The problem was that the environment variables don't contain a path to the ionic folder.
Just do:
npm config set prefix
And then
npm install -g ionic cordova
setting the path variable to C:\Users\«user name folder»\appdata\Roaming\npm helped me to resolve the issue. Please try
uninstall the old version
npm uninstall -g ionic
and try to install it again with the new version
npm install -g #ionic/cli
In my situation, I thought Ionic did not install,
but after I had changed my Windows User-Name, npm did for some reason still install on the last %AppData% folder path.
for example correct-path for new user-name is:
C:\Users\Admin\AppData\Roaming\npm
but npm did use:
C:\Users\Abc\AppData\Roaming\npm
have moved that folder contents to the right place and all just works!
But to finally fix the issue from its root cause I updated NPM settings like:
npm config -g set prefix "%AppData%\npm"
npm config -g set cache "%AppData%\npm-cache"
npm config -g get prefix
And ensured my PATH environment-variable includes the correct NPM directory.
This issue occurs when we change the path variables manually.Because of this change system doesn't find libraries for the command which needed to be executed.
While installing ionic cordova, ionic cli takes cares by adding path variable in your environment.Hope this content helps
path -
C:\user\system_name\AppData\Roaming\npm
I had the same problem on Windows, and I find solution by navigating the command prompt to
C:\Users\[username]\AppData\Roaming\npm>
Cordova, Ionic, etc. are found here.
The following steps worked for me in 2022:
Run the command prompt as Admin. This is mandatory to ensure that ionic is installed globally, otherwise you would continue to see the same error message despite installing ionic.
Type this command and hit enter: npm i -g #ionic/cli
That's it!
'ionic/java/cordova etc..' is not recognized as an internal or external command
for ionic or cordova install it from node using npm install -g ionic/cordova command.
This kind of messages comes whenever its PATH not set properly for other programs like java. System has to recognize your command available on your system or not. This can be identified only when you set your environment variable.
use this for setting your path
SET PATH = %PATH%; your app path to bin
Just follow this video, you have to set your path correctly.
http://learn.ionicframework.com/videos/windows-android/
1: Download and Install Java then open your system environment variables, and add to or create a new user variable called PATH with the full path to the bin folder of the new Java SDK installation.
2: Download Apache Ant then add the full path to the bin/ folder to the end of your PATH environment variable.
3: Add Android to PATH :Open up your environment variables setting and add the full path to both the adt-bundle/sdk/platform-tools/ folder and the adt-bundle/sdk/tools/ folder to the end of your PATH variable:
4.Install nodeJs and now you can do
npm install -g cordova ionic
I started getting this same error in the Console2 command prompt. I checked the environment variables and reinstalled ionic and cordova but this did not fixed it.
I then tried ionic in Node.js command prompt and it worked perfectly. So if you follow the other advice and it still doesn't work, try a different command prompt.
I think you should copy the bin file to the system variables and it should be fine, at least I try it on Win7 and it worked. I also got the same prob like this before.
Right click Computer, choose Properties, Advanced system settings and edit environment variables.
Try reinstalling the ionic
npm install ionic -g
uninstall ionic npm package and then clear all npm cache in appdata and then install ionic
npm install -g ionic
ionic info
you must install ionic package has global so use -g.
ionic info command is used to check the ionic information
Well, after trying several answers from many posts like this one and realizing that my environment variables were there too, I ran the
npm install -g cordova ionic
from the inside of nodejs folder in Program Files with windows prompt as administrator.
Initially I was installing it in my dev folder in D:\ partition. Hope it helps someone.
Probably you doesn't have ionic installed in your device.
First check in terminal/cmd, have you installed ionic or not?
you can check it with following command:
ionic -v
C:\Program Files\nodejs\bin
try adding this to your user and environment variables, under environment variables, and then close the command prompt window and open.
I got my problem resolved :)
npm install -g cordova ionic
and then
ionic start myApp tabs
and then
cd myApp
ionic serve
Firstly uninstall the ionic module from the project by using the following command.
npm uninstall -g ionic cordova
Then install ionic and cordova dependencies seperately as follows.
npm install -g ionic
npm install -g cordova
Please check whether ionic cli is installed or not globally and locally both
Node versions
Check if you are using the nvm,
you would have installed the ionc cli with node version 14.X, and now you might be using node 16.X or latest, this is why the ionic cli is not working in latest node version.
check list of node versions if by using nvm:
nvm list
try changing the node version to previous,
NVM user older node
change to older nvm:
nvm use 14.x.x
or your version in list