Difference between revisions of "Strapi Installation Tips"
(Created page with "For the Mac OS environment, when installing Strapi v. 4.6.1, is common to observe problems with Strapi Installation, it often fails by telling users the following message: {{Blockquote |text= npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! better-sqlite3@7.4.6 install: prebuild-install || npm run build-release npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the better-sqlite3@7.4.6 install script. npm ERR! This is probably not a problem with npm. There is likely a...") |
|||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
For the Mac OS | =Failed to Launch Previously Installed Strapi Instance= | ||
The most likely solution is to run: | |||
<syntaxhighlight lang=bash> | |||
~bash@directory_of_the_strapi_installation > npm rebuild | |||
</syntaxhighlight> | |||
It is probably this instance of [[Strapi]] is having conflict with the globally installed libraries. | |||
=First Time Installation= | |||
One should know that [[Strapi]] works in Mac OS For the '''Mac OS Ventura 13.1''' and above with '''node 18.13.0''' and '''npm 8.19.3'''. | |||
However, when installing Strapi v. 4.6.1, is common to observe problems with Strapi Installation, it often fails by telling users about '''node-gyp''' and '''better-sqlite3''' failed to install: | |||
{{Blockquote | {{Blockquote | ||
|text= | |text= | ||
npm ERR! code ELIFECYCLE | npm ERR! code ELIFECYCLE | ||
npm ERR! errno 1 | npm ERR! errno 1 | ||
Line 21: | Line 30: | ||
cd C:\Users\nazaq\OneDrive\Documents\Business\Strapi\project\backend && npm install | cd C:\Users\nazaq\OneDrive\Documents\Business\Strapi\project\backend && npm install | ||
|sign=[https://forum.strapi.io/t/errors-when-installing-strapi-npx-create-strapi-app-latest-my-project/17744/11 This error message is an excerpt from Strapi.io Website] | |||
}} | }} | ||
After facing the same problem many times, I realized that the best way is to remove the node installation files on your system, and then reinstall Strapi. | |||
One may follow the instruction from [[ChatGPT]]: | |||
1. Remove any Node.js versions installed on your system: | |||
<syntaxhighlight lang=bash> | |||
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} | |||
</syntaxhighlight> | |||
2. Remove the Node.js package manager (npm) cache: | |||
<syntaxhighlight lang=bash> | |||
sudo rm -rf ~/.npm | |||
</syntaxhighlight> | |||
3. Remove any global npm packages you have installed: | |||
<syntaxhighlight lang=bash> | |||
npm ls -g --depth=0 | |||
sudo npm rm -g <package-name> | |||
</syntaxhighlight> | |||
Note that you must go back to the Strapi app directory to remove the ```node_modules``` directory, then run: | |||
<syntaxhighlight lang=bash> | |||
yarn install | |||
</syntaxhighlight> | |||
This procedure seems to better fix the problem of Strapi installation. |
Latest revision as of 10:13, 22 February 2023
Failed to Launch Previously Installed Strapi Instance
The most likely solution is to run:
~bash@directory_of_the_strapi_installation > npm rebuild
It is probably this instance of Strapi is having conflict with the globally installed libraries.
First Time Installation
One should know that Strapi works in Mac OS For the Mac OS Ventura 13.1 and above with node 18.13.0 and npm 8.19.3. However, when installing Strapi v. 4.6.1, is common to observe problems with Strapi Installation, it often fails by telling users about node-gyp and better-sqlite3 failed to install:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.4.6 install: prebuild-install
After facing the same problem many times, I realized that the best way is to remove the node installation files on your system, and then reinstall Strapi.
One may follow the instruction from ChatGPT:
1. Remove any Node.js versions installed on your system:
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
2. Remove the Node.js package manager (npm) cache:
sudo rm -rf ~/.npm
3. Remove any global npm packages you have installed:
npm ls -g --depth=0
sudo npm rm -g <package-name>
Note that you must go back to the Strapi app directory to remove the ```node_modules``` directory, then run:
yarn install
This procedure seems to better fix the problem of Strapi installation.