GithubHelp home page GithubHelp logo

Comments (4)

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024

The serve dependency fast-url-parser can be patched as a temporary measure. Starting with the following:

mkdir serve-test
cd serve-test
npm init -y
npm install serve
export NODE_OPTIONS='--trace-deprecation'
npx serve -v

Workaround

Use npm module patch-package

npm install patch-package

add script to package.json

"postinstall": "patch-package"

Edit node_modules\fast-url-parser\src\urlparser.js
Line 401

Change

var punycode = require("punycode");

to

var punycode = require("punycode/");

then execute

npx patch-package fast-url-parser

To verify, execute again:

npx serve -v

There should be no deprecation message, even when running under Node.js 21.x.

For package managers other than npm, see README of patch-package.

from serve.

tik9 avatar tik9 commented on June 3, 2024

Should I execute the code on top mkdir serve-test.. and then execute the workaround?

from serve.

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024

@tik9

Should I execute the code on top mkdir serve-test.. and then execute the workaround?

You would replace serve-test with the name of your existing repository. Sorry if that was not clear. I just used the name serve-test to demonstrate the principal of patching. You wouldn't normally be creating a new directory if you already have a repository that you are going to patch.

from serve.

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.