Giter Club home page Giter Club logo

Comments (4)

luojh avatar luojh commented on August 24, 2024 1

i get it, thank you !

from javet.

caoccao avatar caoccao commented on August 24, 2024

Good question.

  1. This feature is limited by Node.js runtime for security reason. Once a Node.js host process starts, Node.js runtime doesn't allow setting the working directory out of the initial working directory. Obviously, this is to prevent scripts from attacking the runtime environment.
  2. Node.js runtime also requires the directory to be an actual folder in the file system. That results in the error you met.

My suggestion is to resolve the path so that it becomes the one recognized by Node.js runtime.

from javet.

Quixomatic avatar Quixomatic commented on August 24, 2024

Good question.

  1. This feature is limited by Node.js runtime for security reason. Once a Node.js host process starts, Node.js runtime doesn't allow setting the working directory out of the initial working directory. Obviously, this is to prevent scripts from attacking the runtime environment.
  2. Node.js runtime also requires the directory to be an actual folder in the file system. That results in the error you met.

My suggestion is to resolve the path so that it becomes the one recognized by Node.js runtime.

Sorry for my lack of understanding. What do you mean by resolve the path? I bundled my entire nodejs project into a single dist folder. Was hoping to access that without ever having to leave the JAR file. Everything I have tried so far has failed. Is there any way to access folders in the JAR?

from javet.

caoccao avatar caoccao commented on August 24, 2024

Node.js is keen on real (aka physical) file system path. The file path inside a jar file is not a physical file path from OS perspective. The app has to copy everything to a physical path and point the working dir to it.

from javet.

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.