Git Product home page Git Product logo

Comments (6)

axilleasiv avatar axilleasiv commented on June 10, 2024

Hey @EmranMR , thank you so much for your feedback.

Normally, you don't need to do anything in order to start the repl and just have node.js installed in the system. I am not sure but in this case, it seems that it has to do with the folder's permissions or the node.js access on a specific folder that the repl is creating through the node.js when is starting for the first time.

The folder path that is created in a Unix env is the /Users/$USER/.js-repl and if that helps the permissions for me on this folder and subfolders are the following:

 755 drwxr-xr-x   6 achil  staff   192 Nov 15 23:36 .
 755 drwxr-xr-x+ 98 achil  staff  3136 Nov 15 23:37 ..
 755 drwxr-xr-x   2 achil  staff    64 Nov 15 23:36 images
 755 drwxr-xr-x   3 achil  staff    96 Nov 15 23:36 logs
 644 -rw-r--r--   1 achil  staff     2 Nov 15 23:36 package.json
 755 drwxr-xr-x   3 achil  staff    96 Nov 15 23:36 temp

Also, a link that maybe helps. Let me know if your issue has to do about that.

from vscode-javascript-repl-docs.

EmranMR avatar EmranMR commented on June 10, 2024

Hi @axilleasiv , well, unfortunately all my permissions are the same as yours. These are the things I have tried so far.

  • I am using the macOS BigSur
  • My node.js version is v15.2.0
  • My npm version is 7.0.10
  • The REPL works with any .js regardless of the project directory location
  • There seem to be an issue with both coffee and the TypeScript
  • I checked my permissions in the .js-repl/ as well as my working directory, all of which with read and write permission.
  • I went to Preference>security & privacy>privacy>full access to the disk and gave the VS Code full access
  • I checked my /npm root as well, and that also has the read and write access
    really don't know where else to look, I presume it is something to do with the Big Sur.....🤷‍♂️

Screenshot 2020-11-15 at 22 57 38

Screenshot 2020-11-15 at 22 56 25

from vscode-javascript-repl-docs.

axilleasiv avatar axilleasiv commented on June 10, 2024

The truth is that I have not yet tested the repl in macOS BigSur, maybe it has to do with it. Anyway, I will investigate this further and I will let you know. Thanks for your reply.

from vscode-javascript-repl-docs.

EmranMR avatar EmranMR commented on June 10, 2024

@axilleasiv  🥳
Ah found the issue! it is now working like a charm!!
The issue is that I was using your extension as a playground in folders with no package.json in it

I noticed this when I was working with a locally installed ESLint, upon investigation realised it has nothing to do with the ESLint itself.
All I needed to do for the extension to work, was to have a package.json installed in the directory where the project is

Basically just yarn init or npm init would do the trick, then the extension downloads the Typescript module locally
The error was not pointing to the package.json in the actual working directory.

Note: It won't work if I install typescript globally with yarn or npm. the package.json must be in the actual folder. I personally thought the extension would have its own folder with everything it needed inside the /Users/$USER/.js-repl basically plug and play. But that is not the case. Hope that helps anyone else who get that error.

from vscode-javascript-repl-docs.

axilleasiv avatar axilleasiv commented on June 10, 2024

Hey, @EmranMR I am glad that you have found a solution to this issue, and based on your feedback, I have finally succeeded to reproduce this 😄

The way that the repl is working is that firstly it checks the path of your file that you want to have logs to find a package.json. If a package.json will be found and the users have a local install of TypeScript or CoffeeScript the repl is using the version that has been installed by the users. After that, no package.json or no local install of TypeScript or CoffeeScript found, it should use an internal version that should be found in /Users/$USER/.js-repl. This process seems that working smoothly in the following scenario where:

users want the have a simple playground like in this youtube video where the users don't start the repl for an existing file, folder, or project, so there is not any path to check. In this scenario, it doesn't check for a package.json that has been provided by the users and is checking the folder /Users/$USER/.js-repl, to find an installed TypeScript or CoffeeScript version there depending on the command that users have fired. If for example typescript not found there, the extension automatically installs typescript, and the next time that the JS Repl: New TypeScript file command is fired and no file, folder, or project has been opened in VSCode, it uses this internal installed version.

But it does not work as it is supposed to and if users don't have any package.json in the directory where the project is, the EROFS read-only error is triggered. I will label this as a bug and I hope to provide a fix on the next version that would be released.

Thank you again @EmranMR for your feedback, I really appreciate this.

from vscode-javascript-repl-docs.

axilleasiv avatar axilleasiv commented on June 10, 2024

This has been fixed on the new version. Now, a repl can start without a package.json in the project folder and the TypeScript or CoffeeScript module is installed on the internal cache folder. If there is an already installed version of TypeScript or CoffeeScript in the project, this is the one that is used by the repl.

from vscode-javascript-repl-docs.

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.