medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Error during installation

Open thatcuteseller opened this issue 1 year ago • 5 comments

ubuntu@ip-132-10-2-40:~$ medusa new my-medusa-store ✔ Created starter directory layout – 1065ms info: Installing packages...

npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. npm WARN deprecated @oclif/[email protected]: Deprecated in favor of @oclif/core npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. npm WARN deprecated [email protected]: Use your platform's native DOMException instead npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm ERR! code 1 npm ERR! path /home/ubuntu/my-medusa-store/node_modules/@stdlib/number-float64-base-normalize npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | linux | x64 npm ERR! gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/ubuntu/my-medusa-store/node_modules/@stdlib/number-float64-base-normalize/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/ubuntu/.cache/node-gyp/18.19.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/ubuntu/.cache/node-gyp/18.19.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/ubuntu/.cache/node-gyp/18.19.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/ubuntu/my-medusa-store/node_modules/@stdlib/number-float64-base-normalize', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: binding.gyp not found (cwd: /home/ubuntu/my-medusa-store/node_modules/@stdlib/number-float64-base-normalize) while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess. (/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:271:1 8) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12) npm ERR! gyp ERR! System Linux 6.5.0-1014-aws npm ERR! gyp ERR! command "/home/ubuntu/.nvm/versions/node/v18.19.1/bin/node" "/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node- gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /home/ubuntu/my-medusa-store/node_modules/@stdlib/number-float64-base-normalize npm ERR! gyp ERR! node -v v18.19.1 npm ERR! gyp ERR! node-gyp -v v10.0.1 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /home/ubuntu/.npm/_logs/2024-02-23T12_55_48_432Z-debug-0.log Error: Command failed with exit code 1: npm install at makeError (/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/@medusajs/medusa-cli/node_modules/execa/lib/error.js:60:11) at handlePromise (/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/@medusajs/medusa-cli/node_modules/execa/index.js:118:26) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async install (/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/@medusajs/medusa-cli/dist/commands/new.js:113:13) at async clone (/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/@medusajs/medusa-cli/dist/commands/new.js:173:5) at async newStarter (/home/ubuntu/.nvm/versions/node/v18.19.1/lib/node_modules/@medusajs/medusa-cli/dist/commands/new.js:486:9) { shortMessage: 'Command failed with exit code 1: npm install', command: 'npm install', escapedCommand: 'npm install', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: undefined, stderr: undefined, failed: true, timedOut: false, isCanceled: false, killed: false }

ubuntu@ip-~$ npm install @medusajs/medusa-cli -g npm WARN deprecated @oclif/[email protected]: Deprecated in favor of @oclif/core npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

changed 330 packages in 14s

48 packages are looking for funding run npm fund for details ubuntu@ip-(IP adddres here) :~$ medusa -v Medusa CLI version: 1.3.22

System information

Medusa version (stable): Node.js version: 18 Database: Postgres Operating system:Ubuntu 22.04 Browser (if relevant):

thatcuteseller avatar Feb 23 '24 13:02 thatcuteseller

I accidentally opened up a new issue, and this is pretty much what I get when I run npx create-medusa-app@latest.

oneofvalts avatar Feb 24 '24 14:02 oneofvalts

@oneofvalts I think it does not support node version beyond v18.

thatcuteseller avatar Feb 24 '24 16:02 thatcuteseller

Yes, with v18.17.0, both medusa and storefront runs fine.

oneofvalts avatar Feb 24 '24 17:02 oneofvalts

Yes, with v18.17.0, both medusa and storefront runs fine.

I used node v18.17.0 and getting the same error

beyourahi avatar Feb 25 '24 15:02 beyourahi

Yes, with v18.17.0, both medusa and storefront runs fine.

I used node v18.17.0 and getting the same error

Go and change the node version to the LTS

npm install -g n
n 20.11.1

and try again

greendesertsnow avatar Feb 29 '24 18:02 greendesertsnow

Yes, with v18.17.0, both medusa and storefront runs fine.

I used node v18.17.0 and getting the same error

Go and change the node version to the LTS

npm install -g n
n 20.11.1

and try again

I am on v21.7.1 at it does not work

HadiSDev avatar Mar 20 '24 17:03 HadiSDev

Same for me. I have the LTS installed and it doesn‘t work.

timnielen avatar Mar 20 '24 23:03 timnielen

Same here. I understand that this is opensource, but bugs during installation (when all the prerequisites are installed & followed) really kills the trust for the project.

If this helps: Error: binding.gyp not found OS: Win11 GCC installed, Visual studio build tools installed (2019) Node v20.11.0 Npm 10.5.0

justasam avatar Mar 28 '24 17:03 justasam

@shahednasser, any chance you could look into this one? 🙏

olivermrbl avatar Mar 28 '24 17:03 olivermrbl

For me the error seemed to come from the node-gyp module. In the end I was able to fix the issue by deleting the content of .../AppData/Roaming/npm and reinstalling nodejs.

timnielen avatar Mar 28 '24 21:03 timnielen

For me the error seemed to come from the node-gyp module. In the end I was able to fix the issue by deleting the content of .../AppData/Roaming/npm and reinstalling nodejs.

I've just tried that, still getting the error: An error occurred while preparing project: Error: Command failed: npm install --legacy-peer-deps... npm ERR! gyp: binding.gyp not found

justasam avatar Mar 28 '24 21:03 justasam

@thatcuteseller How did you end up solving this? I'm having this same issue and it looks like justasam is, too.

lampmeorelse avatar Mar 28 '24 23:03 lampmeorelse

Hey guys, can you try re-running the installation process?

shahednasser avatar Mar 29 '24 10:03 shahednasser

I don't want to insist on the same thing but I had a similar issue and resolved it through changing the node version to LTS. Did all of you guys tried chaning your node version to the LTS? It's an easy process with n

npm install -g n
n 20.12.0

image

greendesertsnow avatar Mar 29 '24 10:03 greendesertsnow

I had already been using 20.12.0, but switching to using n to manage versions seems to have done the trick. Medusa installed without issue now! Much appreciated!

lampmeorelse avatar Mar 29 '24 14:03 lampmeorelse

I had already been using 20.12.0, but switching to using n to manage versions seems to have done the trick. Medusa installed without issue now! Much appreciated!

Actually we issued out a fix that should fix it for all versions 😄 so feel free to try out with the version you were using as well

shahednasser avatar Mar 29 '24 14:03 shahednasser

I had already been using 20.12.0, but switching to using n to manage versions seems to have done the trick. Medusa installed without issue now! Much appreciated!

Actually we issued out a fix that should fix it for all versions 😄 so feel free to try out with the version you were using as well

It worked with my version which used to fail beforehand, thanks!! Could you provide any info on what was the solution (e.g. link the PR)?

justasam avatar Mar 29 '24 21:03 justasam

It was actually due to a dependency of another dependency causing the issue, which we resolved in the starter repository that's cloned in the installation process by installing a version of the dependency that fixes the error. This is mostly a temporary solution as we're still figuring out a better one for the original dependency we use.

shahednasser avatar Mar 30 '24 13:03 shahednasser

@shahednasser which dependency? I deployed today on heroku and got the same gyp failure. Our System runs on node 18.x

WoodlegDev avatar Apr 04 '24 20:04 WoodlegDev

@WoodlegDev I fixed it by using n to manage my node version. Worked fine after that.

lampmeorelse avatar Apr 04 '24 22:04 lampmeorelse

@WoodlegDev please install @stdlib/[email protected]. Sorry for the inconvenience, we're looking into putting out a fix soon.

shahednasser avatar Apr 05 '24 06:04 shahednasser