PhantomJS

  • Source Code

Troubleshooting

Latest version.

Before reporting an issue, make sure you are using the latest version:

All examples are designed to work with the latest version of PhantomJS. If some examples do not work, make sure that there is not more than one version of PhantomJS installed in the system. Multiple versions may lead to conflict as to which one is being invoked in the terminal.

Network Problem

If the data is not transferred correctly, check if the network works as expected.

Since every network request and response can be 鈥渟niffed鈥, add simple callbacks to facilitate such troubleshooting. For more details, see the wiki page on Network Monitoring . An example of a simple logging:

Transport Layer Security (TLS) and Secure Sockets Layer (SSL) are necessary to access encrypted data, for example when connecting to a server using HTTPS. Thus, if PhantomJS works well with HTTP but it shows some problem when using HTTPS, the first useful thing to check it whether the SSL libraries, usually OpenSSL, have been installed properly.

On Windows, the default proxy setting may cause a massive network latency (see Known Issues in the release note). The workaround is to disable proxy completely, e.g. by launching PhantomJS with --proxy-type=none command-line argument.

SELinux can stop PhantomJS working. The solution given here, to create a custom policy, has been reported to work: http://serverfault.com/a/430499/87322

Error Handling

To easily catch an error occured in a web page, whether it is a syntax error or other thrown exception, an onError handler for the WebPage object has been added. An example on such a handler is:

Now if the page opens a site with some JavaScript exceptions, a detailed information (including the stack trace) will be printed out.

Remote Debugging

Remote debugging permits inspection of the script and web page via another WebKit-based browser (Safari and Chrome). This is achieved by launching PhantomJS with the new option, as in this example

After that, open Safari/Chrome/Chromium and go to the URL http://ipaddress:9000 . If you executed the phantomjs command on the same machine, it will be http://127.0.0.1:9000

You will see a list of links. Click the first (it may say 鈥渁bout:blank鈥). It will show a version of the Web Inspector interface which in this case works on the script being tested..

To set breakpoints, look for your script in the drop-down in the Scripts tab; it should have the same URL that you just clicked on.

After setting breakpoints (or if you are using debugger instead), to run your script, simply enter the __run() command in the Web Inspector Console. Alternatively, use --remote-debugger-autorun=yes command-line argument to have your script launched immediately.

To debug inside a target web page requires two inspectors and a multi-step process using code like this:

  • Instrument your PhantomJS script with two debugger; lines as in the example above.
  • Start PhantomJS on the command line with the --remote-debugger-port=9000 option.
  • Open http://127.0.0.1:9000/ in a Webkit-based web browser.
  • There should be a bulleted list with a single link. Click on it to open a web inspector that operates in the PhantomJS context. (Sometimes the link is invisible because it contains no text; if you see nothing, navigate directly to http://127.0.0.1:9000//webkit/inspector/inspector.html?page=1.)
  • Change to the Console section of the inspector and execute the statement __run() . This should cause the script to run until your first debugger; statement.
  • Open a new browser tab and return to the debugging portal at http://127.0.0.1:9000. There should now be a second entry in the bulleted list.
  • Click on this entry to open a new debugger that operates in the context of your page inside PhantomJS.
  • Return to the first web inspector tab and click the 鈥淐ontinue鈥 button in the debugger.
  • In the second tab, you should now find the JS debugger paused at the second debugger; statement. You can now debug your page鈥檚 JS using the full capabilities of the Webkit inspector.

Interactive Mode (REPL)

If PhantomJS is launched without any argument, it starts in the so-called interactive mode, also known as REPL (read-eval-print-loop). This mode allows a faster cycle of experiment and script prototyping. PhantomJS REPL supports the expected features: command editing, persistent history, and autocomplete (with Tab key). Read more about REPL .

Documentation

  • Get Started
  • D Inter Process Communication
  • D Command Line Interface
  • D Troubleshooting
  • D Best Practices
  • D Tips and Tricks
  • D Supported Web Standards
  • D Who's using PhantomJS?
  • D Related Projects
  • D Contributing
  • D Test Suite
  • D Release Preparation
  • D Crash Reporting
  • D Bug Reporting

© Copyright 2010-2020 Ariya Hidayat — Homepage design by Maurice Svay — Documentation design by Jamie Mason .

This package has been deprecated

Author message:

  • 3 Dependencies
  • 364 Dependents
  • 108 Versions

phantom - Fast NodeJS API for PhantomJS

NPM

Super easy to use

Using Node v7.9.0+ you can run the above example with node file.js

See examples folder for more ways to use this module.

Use it with npx

You can quickly test any website with phantomjs-node without needing to install the package.

The above command is very useful to test if your website works on older browsers. I frequently use it to ensure polyfills have been installed correctly.

Deprecation warnings of PhantomJs

In March 2018, the owner of PhantomJS announced suspension of development. There hasn't been any updates since. Since phantomjs-node is only a wrapper around phantomjs, then you should use it at your own risk because the underlying dependency is no longer supported. I plan to maintain this project until usage has dropped significantly.

Installation

Node v6.x and later.

Latest version of phantom does require Node v6.x and later . You can install with

To use version 3.x you need to have at least Node v5+. You can install it using

Versions older than 5.x, install with

Creating new phantom instances with phantom.create() can be slow. If you are frequently creating new instances and destroying them, as a result of HTTP requests for example, it might be worth creating a pool of instances that are re-used.

See the phantom-pool module for more info.

To run the test suite, first install the dependencies, then run npm test :

Contributing

This package is under development. Pull requests are welcomed. Please make sure tests are added for new functionalities and that your build does pass in TravisCI.

The current lead maintainer is Amir Raminfar

List of all contributors

Package Sidebar

npm i phantom

Git github.com/amir20/phantomjs-node

github.com/amir20/phantomjs-node

Downloads Weekly Downloads

Unpacked size, total files, last publish.

4 years ago

Collaborators

amir20

  • Advertise with us
  • Explore by categories
  • Free Online Developer Tools
  • Privacy Policy
  • Comment Policy

How to use PhantomJS with Node.js

Carlos Delgado

Carlos Delgado

  • February 09, 2017
  • 47.9K views

Learn how to use PhantomJS by your own or using a module.

How to use PhantomJS with Node.js

PhantomJS is a headless WebKit scriptable with a JavaScript API multiplatform, available on major operating systems as: Windows, Mac OS X, Linux, and other Unices. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.聽PhantomJS is fully rendering pages under the hood, so the results can be exported as images. This is very easy to set up, and so is a useful approach for most projects requiring the generation of many browser screenshots (if you're looking how to create only screenshots we recommend you to read instead this article ).

In this article, you will learn how to use PhantomJS with Node.js easily using聽a module or manipulating it by yourself with Javascript.

Requirements

You will need PhantomJS (installed or a standalone distribution) accesible from the PATH (learn how to add a variable to the PATH in windows here). In case it isn't available in the path, you can specify the executable to PhantomJS in the configuration later.

You can obtain PhantomJS from the following list in every platform (Windows, Linux, MacOS etc)聽 in the download area of the official website here .

there's no installation process in most of the platforms as you'll get .zip file with two folder, examples and bin (which contains the executable of PhantomJS).

Once you know that PhantomJS is available in your machine, let's get started !

A. Using a module

If you want to use a module聽to work with PhantomJS in Node.js, you can use the phantom module written by @amir20 . This module聽offers integration for PhantomJS in Node.js. Although the workflow with Javascript ain't the same that the Javascript that you use to instruct PhantomJS, it's still easy to understand.

To install the module in your project, execute the following command in the terminal:

Once the installation of the module finishes, you will be able to access the module using require("phantom") .

The workflow (of creating the page and then with the page do other things) remains similar to the scripting with plain Javascript in PhantomJS.聽The page object that is returned with createPage method is a proxy that sends all methods to phantom. Most method calls should be identical to PhantomJS API. You must remember that each method returns a Promise.

The following script will open the Stack Overflow website and will print the html of the homepage in the console:

If you're using Node.js v7+, then you can use the async and await features that this version offers.聽

It simplifies the code significantly and is much easier to understand than with Promises.

B. Own implementation

As you probably (should) know, you work with PhantomJS through a js file with some instructions, then the script is executed providing the path of the script as first argument in the command line ( phantomjs /path.to/script-to-execute.js ). To learn how you can interact with PhantomJS using Node.js create the following test script ( phantom-script.js ) that works with PhantomJS perfectly. If you want to test it, use聽the command phantomjs phantom-script.js in a terminal:

The previous code should simply create a POST request to a website (check obviously that you have internet access while testing it).

Now we are going to use Node.js to cast a child process, this Node script should execute the following command (the same used in the command line):

To do it, we are going to require the child_process module (available by default in Node.js) and save the spawn property in a variable.聽The child_process.spawn() method spawns a new process using the given command (as first argument), with command line arguments in args (as second argument). If omitted, args defaults to an empty array.

Declare a variable child that has as value the returned value from the used spawn method. In this case the first argument for spawn should be the path to the executable of聽phantomjs (only phantomjs if it's in the path) and the second parameter should be an array with a single element, the path of the script that phantom should use. From the child variable add a data listener for the stdout (standard output) and stderr (Standard error output). The callback of those listeners will receive an Uint8Array, that you obviously can't read unless you convert it to string. To convert the Uint8Array to its string representation, we are going to use the Uint8ArrToString method (included in the script below). It's a very simple way to do it, if you require scability in your project, we recommend you to read more ways about how to convert this kind of array to a string here .

Create a new script ( executing-phantom.js ) with the following code inside:

As final step execute the previous node script using:

And in the console you should get the following output:

We, personally prefer the self implemented method to work with PhantomJS as the learning curve of the module is steep (at least for those that knows how to work with PhantomJS directly with scripts), besides the documentation ain't so good.

Happy coding !

Senior Software Engineer at Software Medico . Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Become a more social person

Related articles.

Getting started with Optical Character Recognition (OCR) with Tesseract in Node.js

Getting started with Optical Character Recognition (OCR) with Tesseract in Node.js

  • January 02, 2017
  • 33.5K views

How to use Event Emitters with ES5 and ES6 in Node.js easily

How to use Event Emitters with ES5 and ES6 in Node.js easily

  • May 02, 2017
  • 38.8K views

How to create a sftp client with node.js (SSH2) in Electron Framework

How to create a sftp client with node.js (SSH2) in Electron Framework

  • May 01, 2016
  • 71.3K views

How to connect to a MySQL database with Node.js

How to connect to a MySQL database with Node.js

  • September 20, 2016
  • 84.8K views

How to install and use lwip (Light Weight Image Processor) in Windows for Node.js

How to install and use lwip (Light Weight Image Processor) in Windows for Node.js

  • October 17, 2016
  • 11.6K views

How to obfuscate JavaScript code with Node.js

How to obfuscate JavaScript code with Node.js

  • October 15, 2017
  • 49.1K views

Advertising

Free Digital Ocean Credit

All Rights Reserved © 2015 - 2024

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

Both error when install using "npm install phantomjs" and "node ./install.js" on mac #156

@zhaoyingx

zhaoyingx commented May 8, 2014

@dpup

dpup commented May 8, 2014

Sorry, something went wrong.

@ghost

ghost commented May 14, 2014

Zhaoyingx commented may 15, 2014.

@fengmk2

fengmk2 commented May 21, 2014

@fengmk2

kylinsoong commented Jan 25, 2016

Fengmk2 commented jan 25, 2016.

@humitos

humitos commented Mar 7, 2017

@Adrian0350

Adrian0350 commented Apr 12, 2018

@beebird

beebird commented Dec 13, 2018

Successfully merging a pull request may close this issue.

@fengmk2

Site navigation

Table of contents, common errors, broken npm installation, random errors, no compatible version found, permissions errors, error: enoent, stat 'c:\users\<user>\appdata\roaming\npm' on windows 7, running a vagrant box on windows fails due to path length issues, npm only uses git: and ssh+git: urls for github repos, breaking proxies, ssl-intercepting proxy, not found / server error, invalid json, many enoent / enotempty errors in output, cb() never called when using shrinkwrapped dependencies, npm login errors, npm hangs on windows at addremotetarball, npm not running the latest version on a windows machine.

If your npm is broken:

  • On Mac or Linux, reinstall npm .
  • Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version ).
  • Some strange issues can be resolved by simply running npm cache clean and trying again.
  • If you are having trouble with npm install , use the -verbose option to see more details.

You have an outdated npm. Please update to the latest stable npm .

Please see the discussions in " Downloading and installing Node.js and npm " and " Resolving EACCES permissions errors when installing packages globally " for ways to avoid and resolve permissions errors.

The error Error: ENOENT, stat 'C:\Users\<user>\AppData\Roaming\npm' on Windows 7 is a consequence of joyent/node#8141 , and is an issue with the Node installer for Windows. The workaround is to ensure that C:\Users\<user>\AppData\Roaming\npm exists and is writable with your normal user account.

You are trying to install on a drive that either has no space, or has no permission to write.

  • Free some disk space or
  • Set the tmp folder somewhere with more space: npm config set tmp /path/to/big/drive/tmp or
  • Build Node yourself and install it somewhere writable with lots of space.

You need to install git . Or, you may need to add your git information to your npm profile. You can do this from the command line or the website. For more information, see " Managing your profile settings ".

@drmyersii went through what sounds like a lot of painful trial and error to come up with a working solution involving Windows long paths and some custom Vagrant configuration:

This is the commit that I implemented it in , but I'll go ahead and post the main snippet of code here: config.vm.provider "virtualbox" do |v| v.customize ["sharedfolder", "add", :id, "--name", "www", "--hostpath", (("//?/" + File.dirname(__FILE__) + "/www").gsub("/","\\"))] end config.vm.provision :shell, inline: "mkdir /home/vagrant/www" config.vm.provision :shell, inline: "mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` > www /home/vagrant/www", run: "always" In the code above, I am appending \\?\ to the current directory absolute path. This will actually force the Windows API to allow an increase in the MAX_PATH variable (normally capped at 260). Read more about max path . This is happening during the sharedfolder creation which is intentionally handled by VBoxManage and not Vagrant's "synced_folder" method. The last bit is pretty self-explanatory; we create the new shared folder and then make sure it's mounted each time the machine is accessed or touched since Vagrant likes to reload its mounts/shared folders on each load.

@LaurentGoderre fixed this with some Git trickery :

I fixed this issue for several of my colleagues by running the following two commands: git config --global url. "https://github.com/" .insteadOf [email protected]: git config --global url. "https://" .insteadOf git:// One thing we noticed is that the .gitconfig used is not always the one expected so if you are on a machine that modified the home path to a shared drive, you need to ensure that your .gitconfig is the same on both your shared drive and in c:\users\[your user]\

You are trying to talk SSL to an unencrypted endpoint. More often than not, this is due to a proxy configuration error (see also this helpful, if dated, guide ). In this case, you do not want to disable strict-ssl 鈥 you may need to set up a CA / CA file for use with your proxy, but it's much better to take the time to figure that out than disabling SSL protection.

This problem will happen if you're running Node 0.6. Please upgrade to node 0.8 or above. See this post for details .

You could also try these workarounds: npm config set ca "" or npm config set strict-ssl false

npm no longer supports its self-signed certificates

  • upgrade your version of npm npm install npm -g --ca=""
  • tell your current version of npm to use known registrars npm config set ca=""

If this does not fix the problem, then you may have an SSL-intercepting proxy. (For example, https://github.com/npm/npm/issues/7439#issuecomment-76024878 )

Unsolved. See https://github.com/npm/npm/issues/9282

  • It's most likely a temporary npm registry glitch. Check npm server status and try again later.
  • If the error persists, perhaps the published package is corrupt. Contact the package owner and have them publish a new version of the package.
  • Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later.
  • This can be caused by corporate proxies that give HTML responses to package.json requests. Check npm's proxy configuration .
  • Check that it's not a problem with a package you're trying to install (e.g. invalid package.json ).

npm is written to use resources efficiently on install, and part of this is that it tries to do as many things concurrently as is practical. Sometimes this results in race conditions and other synchronization issues. As of npm 2.0.0, a very large number of these issues were addressed. If you see ENOENT lstat , ENOENT chmod , ENOTEMPTY unlink , or something similar in your log output, try updating npm to the latest version. If the problem persists, look at npm/npm#6043 and see if somebody has already discussed your issue.

Take a look at issue #5920 . We're working on fixing this one, but it's a fairly subtle race condition and it's taking us a little time. You might try moving your npm-shrinkwrap.json file out of the way until we have this fixed. This has been fixed in versions of npm newer than [email protected] , so update to npm@latest .

Sometimes npm login fails for no obvious reason. The first thing to do is to log in at https://www.npmjs.com/login and check that your e-mail address on npmjs.com matches the email address you are giving to npm login .

If that's not the problem, or if you are seeing the message "may not mix password_sha and pbkdf2" , then

  • Log in at https://npmjs.com/
  • Change password at https://npmjs.com/password 鈥 you can even "change" it to the same password
  • Clear login-related fields from ~/.npmrc 鈥 e.g., by running sed -ie '/registry.npmjs.org/d' ~/.npmrc

and it generally seems to work.

See https://github.com/npm/npm/issues/6641#issuecomment-72984009 for the history of this issue.

Check if you have two temp directories set in your .npmrc :

Look for lines defining the tmp config variable. If you find more than one, remove all but one of them.

See https://github.com/npm/npm/issues/7590 for more about this unusual problem.

See the section about Windows here .

lukekarrys

IMAGES

  1. python

    node phantomjs error

  2. node.js

    node phantomjs error

  3. python

    node phantomjs error

  4. node.js

    node phantomjs error

  5. node 瀹夎phantomjs-prebuilt 鎶ラ敊瑙e喅鏂规

    node phantomjs error

VIDEO

  1. 67 Node js Developer

  2. Lect9.6-1 Concerns of manual digitizing

  3. How To Handle Errors in Node.js and TypeScript

  4. Subsquid Node run error solution #airdrop #cryptocurency #israel #bitcoin #subsquid #node #trending

  5. Express.js with TypeScript in 4min

  6. Handling Errors

COMMENTS

  1. Error installing PhantomJS with NPM / NodeJS

    node.js - Error installing PhantomJS with NPM / NodeJS - Stack Overflow Error installing PhantomJS with NPM / NodeJS Ask Question Asked 8 years, 10 months ago Modified 3 years, 6 months ago Viewed 6k times 2 I recently cannot install PhantomJS anymore inside of my Vagrant Box. "npm install phantomjs" fails.

  2. Troubleshooting

    Error Handling To easily catch an error occured in a web page, whether it is a syntax error or other thrown exception, an onError handler for the WebPage object has been added. An example on such a handler is: page.onError = function (msg, trace) { console.log(msg); trace.forEach(function(item) { console.log(' ', item.file, ':', item.line); }); };

  3. node.js amazon-ec2 phantomjs node-html-pdf

    3 Answers Sorted by: 0 try with setting the path of phantomJS

  4. phantomjs

    phantomjs Share Improve this question Follow edited Nov 15, 2017 at 13:26 asked Nov 15, 2017 at 12:42 clarkk 27.2k 72 203 352 You might want to be sure system is built in as I just checked the Node docs and didn't find system listed. What version of Node are you running? - codejockie Nov 15, 2017 at 12:47 Node v8.9.1 . - clarkk

  5. phantomjs

    Running bin/phantomjs [phantom arguments] And npm will install a link to the binary in node_modules/.bin as it is wont to do. Running via node The package exports a path string that contains the path to the phantomjs binary/executable. Below is an example of using this package via node. var path = require('path')

  6. Problems directly using PhantomJS in node.js

    2 Answers Sorted by: 53 PhantomJS is not for Node.js. You are likely running the examples through node binary. Read the Getting Started documentation carefully and you'll see that every single PhantomJS example need to be invoked like: phantomjs hello.js

  7. Failed at the [email protected] install script 'node install.js ...

    Failed at the [email protected] install script 'node install.js'. 路 Issue #344 路 Medium/phantomjs 路 GitHub Failed at the [email protected] install script 'node install.js'. #344 Closed polinac opened this issue on May 22, 2015 路 17 comments to subscribe to this conversation on GitHub Sign in GitHub is where people build software.

  8. phantomjs-prebuilt

    Running bin/phantomjs [phantom arguments] And npm will install a link to the binary in node_modules/.bin as it is wont to do. Running via node The package exports a path string that contains the path to the phantomjs binary/executable. Below is an example of using this package via node. var path = require('path')

  9. Failed at the [email protected] install script 'node install.js' #644

    npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE. npm ERR! [email protected] install: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node install.js'. npm ...

  10. "html-pdf: Failed to load PhantomJS module. You have to set ...

    馃槙 Thanks VijayakumarManickam ^2.2.0 in my 6 1 npm link html-pdf that resulted in d:\nodejs\html-pdf -> d:\nodejs\node_modules\html-pdf\bin\index.js > [email protected] install d:\nodejs\node_modules\html-pdf\node_modules\phantomjs-prebuilt > node install.js PhantomJS not found on PATH

  11. Failed to load PhantomJS module #212

    Failed to load PhantomJS module #212 Closed opened this issue on Dec 2, 2016 路 12 comments install this module html-pdf (mine is Ver2.1.0) Go to node_modules folder then delete folder phantomjs-prebuilt that come along with this html-pdf installation, then do npm install [email protected] (thanks to @glenn-allen 馃憤馃徎).

  12. PhantomJS not found on PATH

    PhantomJS not found on PATH - installation via npm install #125 Closed limh25 opened this issue on Aug 30, 2022 路 2 comments Operating system: Amazon Linux 2 Browser: command line Version (e.g. auspice 2.7.0 ): nextstrain.cli 4.1.1, node v16.15.0, npm 8.5.5; nextstrain.cli updated to 4.2.0 and still getting the same error.

  13. phantom

    There hasn't been any updates since. Since phantomjs-node is only a wrapper around phantomjs, then you should use it at your own risk because the underlying dependency is no longer supported. I plan to maintain this project until usage has dropped significantly. Installation Node v6.x and later. Latest version of phantom does require Node v6.x ...

  14. node.js

    phantomjs html-pdf Share Follow edited Dec 1 at 20:34 Nageen 1,661 3 23 28 asked Nov 30 at 11:50 Vsn 1 2 Please provide enough code so others can better understand or reproduce the problem. - Community Bot Nov 30 at 13:16 Add a comment 1554 7 2 Load 5 more related questions Know someone who can answer?

  15. PhantomJS not found on PATH 路 Issue #808 路 Medium/phantomjs

    Open zhouLion opened this issue on Aug 8, 2018 路 6 comments 1.download phantomjs zip file manually from here 2.unzip the zip file to your disk path as you want 3.set EnvironmentVariable,add 'PhantomJS' to your PATH mentioned this issue Sign up for free to subscribe to this conversation on GitHub . Already have an account? Sign in . Assignees Labels

  16. How to use PhantomJS with Node.js

    A. Using a module If you want to use a module to work with PhantomJS in Node.js, you can use the phantom module written by @amir20. This module offers integration for PhantomJS in Node.js. Although the workflow with Javascript ain't the same that the Javascript that you use to instruct PhantomJS, it's still easy to understand.

  17. Both error when install using "npm install phantomjs" and "node

    161 Pull requests 13 Actions Projects Insights Both error when install using "npm install phantomjs" and "node ./install.js" on mac #156 Closed on May 8, 2014 is a timeout error you need to npm install the dependencies On May 8, 2014 12:24 AM, "ZhaoYing" [email protected] wrote: . Already have an account? Sign in .

  18. node.js

    node.js, Error: Cannot find module 'express' 660 Installing a local module using npm? 335 Npm install cannot find module 'semver' Load 6 more related questions Show fewer related questions Sorted by: Reset to default Know someone who can answer? Share a link ...

  19. Common errors

    Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN. npm no longer supports its self-signed certificates. Either: upgrade your version of npm npm install npm -g --ca="". tell your current version of npm to use known registrars npm config set ca="". If this does not fix the problem, then you may have an SSL-intercepting proxy.

  20. reactjs

    Did you previously install Node at the system level? I am guessing you might have, and that's what next is picking up. Look for system in your nvm list and see if that matches. If it does then you can uninstall it and try again, but do so in a new terminal to ensure your PATH is updated.

  21. Error message "node: --openssl-legacy-provider is not allowed in NODE

    Change nvm to use node version 18 or above; Remove export NODE_OPTIONS=--openssl-legacy-provider from npmrc by following below steps a. open ~/.npmrc b. remove line export NODE_OPTIONS=--openssl-legacy-provider from it and save