shibd opened a new pull request, #378:
URL: https://github.com/apache/pulsar-client-node/pull/378

   ### Motivation
   - 
https://github.com/apache/pulsar-client-node/issues/226#issuecomment-1917492231
   - https://lists.apache.org/thread/6rmk2m09q1c4f2g3s8thf5fgd0vsfryv
   
   After #301, will use the [Mozilla 
CA](https://nodejs.org/api/tls.html#tlsrootcertificates) certificate provided 
by the node.js. And use the `fs.rmSync` API to generate a local ca when install.
   
   But the [fs.rmSync](https://nodejs.org/api/fs.html#fsrmsyncpath-options) was 
introduced in Node.js v14.14.0, so an error will occur when installing now.
   ```
   TypeError: fs.rmSync is not a function
   ```
   
   ### Modifications
   - Use `fs.existsSync and unlinkSync ` instead of `fs.rmSync`.
   - Since [Mozilla CA](https://nodejs.org/api/tls.html#tlsrootcertificates) 
requires a Node.js version greater than `v12.3.0`, the `README` and 
`package.json` should be modified to indicate that it is only compatible with 
versions 12.3.0 and above.
   
   
   ### Verifying this change
   Test on ubuntu-22.04
   
   Use node.js v12.3.0 can work.
   ```shell
   gitpod /workspace/pulsar-client-node (compatible_version) $ npm install
   npm WARN read-shrinkwrap This version of npm is compatible with 
lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. 
I'll try to do my best with it!
   
   > [email protected] install /workspace/pulsar-client-node
   > node-pre-gyp install --fallback-to-build && node GenCertFile.js
   
   [pulsar-client] Success: 
"/workspace/pulsar-client-node/lib/binding/pulsar.node" already installed
   Pass --update-binary to reinstall or --build-from-source to recompile
   npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] 
(node_modules/fsevents):
   npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"linux","arch":"x64"})
   
   added 746 packages from 559 contributors and audited 748 packages in 10.463s
   found 6 moderate severity vulnerabilities
     run `npm audit fix` to fix them, or `npm audit` for details
   ```
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
   
   - [x] `doc-not-needed` 
   (Please explain why)
   
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to