Mark as Node/React project
已回答
Is it possible to let intellij know that the currently open project has nothing to do with java?
E.g. I can't find a 'new directory' button when trying to add a new one. Instead, it's labelled "New Package", which probably comes from the java world.
请先登录再写评论。
How did you create the project? What is its structure?
Where do you right-click to get the "New Package" button?
Hello Arina,
the project was created externally.
The structure is somewhat standard and goes something like this:
root
| - public
| - src (apis/assets/components/views)
| - types
| - node_modules
| - .husky
and lots of config files such as package.json, tsconfig.json, webpack.dev.js etc.
The "New Package" button is visible when I click on any directory in the project window and click new. Picture attached.
What SDK is chosen for the project in File | Project Structure | Project?
Please also attach a screenshot of the Project Structure | Modules screen, Sources tab.
Is the issue reproducible with all of the downloaded plugins disabled and IDE restarted? Preferences | Plugins | ⚙ | Disable all downloaded plugins
Seems to be partially related to the fact that I had src marked as sources root. Removing that made the 'package' keyword change to directory again.
Oddly enough, trying to replicate between two different projects, I noticed that the modules screen has no tabs in one of them. Screenshot below.
Thanks for the help!
The "Package" instead of "Directory" is intended here.
When a folder is marked as a source root, we change the "Directory" to "Package" there because the folder is now a package in this folder for Java. And you could use `aa.bb` to create an `bb` folder in `aa` folder.
Though I agree this might be odd if your project is not related to Java.
But you could still use that "Package" menu to create any directory there. Also you could unmark it as the source root for your node.js project.
> Oddly enough, trying to replicate between two different projects, I noticed that the modules screen has no tabs in one of them. Screenshot below.
Can you share a screenshot of it? Thanks.