Node_modules not added to $PATH in terminal

已回答

I have a project structured like so:

deploy
sites (php sites)
nx (angular code)
|- node_modules

Now, when working with IntelliJ IDEA 2024.2, and opening a terminal, I expect that 

./nx/node_modules/.bin is added to the $PATH. 

As that works for all other projects. 

However, it isn't. The difference is that I don't have a package.json on root level. As soon as I add a package.json on root level, and I open a new terminal the node_modules `(also on root level) is added to my PATH.

To separate my ‘sites’ from my angular (javascript) code, (and future NestJS backend code, also javascript) I want to have the package.json in the NX folder

As a result, I can't run commands (like ‘nx’) on the command line.

0

Indeed, this option only works if there is a package.json in the project root directory. If you miss a possibility to add node_modules/.bin from nested folders to $PATH for project structure like yours, please file a feature request to https://youtrack.jetbrains.com/issues/IJPL. We’ll see if it can be done.

0

请先登录再写评论。