Comments (6)
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.
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.....🤷♂️
from vscode-javascript-repl-docs.
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.
@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.
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 theJS 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.
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)
- How to get the directory where the script is located? HOT 3
- Context menu HOT 3
- [BUG] - Bcrypt not running properly HOT 2
- The URL class anywhere in the input breaks execution HOT 3
- Strict mode "use strict" HOT 7
- Can't seem to make it work as NodeJS REPL inside Gatsby project HOT 3
- extension not working at all (critical error) HOT 20
- React Project Malfunctioning
- Promises is always pending. Can't see value.
- How to set Node.js path manually, the extension can't seem to find node.js in the $PATH but it exists HOT 8
- Error when using imported function, but works well if the imported function actually copied into the source code
- abandoned plugin? HOT 1
- Support XDG config location $XDG_CONFIG_HOME
- What do you think about releasing the code?
- "SyntaxError: Support for the experimental syntax 'classPrivateMethods' isn't currently enabled"
- Doesn't work on vue 3
- Stopped working since December HOT 6
- [BUG]: Nullish coalescing operator broke math operations
- unexpected error
- Doesn't work with typescript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-javascript-repl-docs.