Code Monkey home page Code Monkey logo

Comments (5)

davea38 avatar davea38 commented on September 26, 2024

Found a workaround for using v18.16.0:

  • Install cross-env
npm i --save-dev cross-env
  • Alter the package.json script to add in this:
cross-env NODE_OPTIONS=--openssl-legacy-provider <proxyLaunch>

So for me the package.json line was:

{ "proxy": "cross-env NODE_OPTIONS=--openssl-legacy-provider node ./.sp-rest-proxy/server.js", }

Of course the other workaround is to revert to using v16.20.0 :)

from sp-rest-proxy.

davea38 avatar davea38 commented on September 26, 2024

Found a workaround for using v18.16.0:

  • Install cross-env
npm i --save-dev cross-env
  • Alter the package.json script to add in this:
cross-env NODE_OPTIONS=--openssl-legacy-provider <proxyLaunch>

So for me the package.json line was:

{ "proxy": "cross-env NODE_OPTIONS=--openssl-legacy-provider node ./.sp-rest-proxy/server.js", }

Of course the other workaround is to revert to using v16.20.0 :)

Having said all of that using --openssl-legacy-provider still gives socket hang up errors, so the best solution is to revert node version to v16.

There error this time was:

Error FetchError: request to https://...admin/_api/web/lists/getByTitle(%27List%27)/items?$filter=OpportunityId_List%20eq%20%27222655,175452,213883,OP75509,194456,162443,OP74527,206207,162672,158434,173954,164109,175451,201289,173955%27 failed, reason: socket hang up
    at ClientRequest.<anonymous> (C:\...\node_modules\node-fetch\lib\index.js:1505:11)
    at ClientRequest.emit (node:events:513:28)
    at ClientRequest.emit (node:domain:489:12)
    at TLSSocket.socketOnEnd (node:_http_client:526:9)
    at TLSSocket.emit (node:events:525:35)
    at TLSSocket.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1359:12)

from sp-rest-proxy.

davea38 avatar davea38 commented on September 26, 2024

Hi, @koltyakov I don't suppose you have an update for this please?

from sp-rest-proxy.

kokoc58 avatar kokoc58 commented on September 26, 2024

sp-rest-proxy does not work with Node 20
"Бен, это Данила айнидхелп...."

from sp-rest-proxy.

koltyakov avatar koltyakov commented on September 26, 2024

@kokoc58 to run it with Node.js >= 18 you need to start in Node.js process with NODE_OPTIONS env variable with --openssl-legacy-provider.

npx cross-env NODE_OPTIONS=--openssl-legacy-provider ts-node ./src/server

image

image

Alternatively, we can contribute to node-sp-auth e.g. by replacing legacy NTLM client maybe with https://www.npmjs.com/package/@ewsjs/ntlm-client

What auth strategy do you use, Данила? :)

Does is work for you with NODE_OPTIONS=--openssl-legacy-provider? If not, what's the error?

from sp-rest-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.