System Information
- Strapi Version: 3,.5.3
- Operating System: Debian 10
- Database: MariaDB 10.3
- Node Version: 14.16.0
- NPM Version: 6.14.11
- Yarn Version: 0.32+git
I am trying to install strapi and create a project, but I’d like them to be different directories. I’ll admit that I am new to working with node.
I’ve installed strapi as a software user in /opt/strapi, to make it available to all users on the system:
$ npm install --prefix=/opt/strapi/3.5.3 strapi@3.5.3 -g
and a link in /usr/local:
$ /opt/strapi/3.5.3/bin/strapi /usr/local/bin/strapi
/opt/strapi is about 75 MB
Then I create the poject as my own user in my own home:
$ strapi new myproject
It simply installs strapi again and all of the modules that already come with the system-installed node, for a total of 650 MB, in the project directory (myproject).
I also tried setting NODE_PATH to help the process find the already-installed modules:
$ export NODE_PATH=/usr/lib/node_modules/npm/node_modules:/opt/strapi/default/lib/node_modules/strapi/node_modules
… , but this made no difference. I used the Linux strace command to see that the NODE_PATH dirs clearly weren’t even referenced before the modules were all downloaded all over again.
How do have the project creation not install all of the modules it needs in the project dir?
Brian