shopify-ftp icon indicating copy to clipboard operation
shopify-ftp copied to clipboard

Running Commands on Shopify

Open InterfixDirect opened this issue 9 years ago • 10 comments

Hello, I'm trying to use this on my current Shopify Store, but cannot work out how to run commands on there... I'm fairly new to this type of thing and need some help! Thank you

InterfixDirect avatar Jul 13 '16 13:07 InterfixDirect

shopify-ftp, as far as I'm aware, is only used to create a local(on your computer) FTP server. Then using an FTP program like Filezilla you connect, using your Shopify site API info, to 127.0.0.1 port 2121, which then displays your Shopify site theme folders. Here is how I use shopify-ftp on my Windows PC:

  • Once it's installed I run CMD.exe and type in(without quotes) "shopify ftp"
  • It will then display: FTP server listening on 127.0.0.1:2121
  • Then I start up Filezilla and connect to 127.0.0.1 on port 2121. Once started it displays my theme folders, which I can navigate and upload or download files.
  • When I am done I close Filezilla and the CMD window.

bxmas13 avatar Jul 13 '16 15:07 bxmas13

Hi, thank you – that helps.

However, I have come across this error when trying to install on my PC – UNABLE_TO_VERIFY_LEAF_SIGNATURE. The full log is below;

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'install', 1 verbose cli '-g', 1 verbose cli 'shopify-ftp' ] 2 info using [email protected] 3 info using [email protected] 4 verbose install initial load of C:\Users*****\AppData\Roaming\npm\package.json 5 verbose readDependencies loading dependencies from C:\Users*****\AppData\Roaming\npm\package.json 6 silly cache add args [ 'shopify-ftp', null ] 7 verbose cache add spec shopify-ftp 8 silly cache add parsed spec Result { 8 silly cache add raw: 'shopify-ftp', 8 silly cache add scope: null, 8 silly cache add name: 'shopify-ftp', 8 silly cache add rawSpec: '', 8 silly cache add spec: 'latest', 8 silly cache add type: 'tag' } 9 silly addNamed shopify-ftp@latest 10 verbose addNamed "latest" is being treated as a dist-tag for shopify-ftp 11 info addNameTag [ 'shopify-ftp', 'latest' ] 12 silly mapToRegistry name shopify-ftp 13 silly mapToRegistry using default registry 14 silly mapToRegistry registry https://registry.npmjs.org/ 15 silly mapToRegistry data Result { 15 silly mapToRegistry raw: 'shopify-ftp', 15 silly mapToRegistry scope: null, 15 silly mapToRegistry name: 'shopify-ftp', 15 silly mapToRegistry rawSpec: '', 15 silly mapToRegistry spec: 'latest', 15 silly mapToRegistry type: 'tag' } 16 silly mapToRegistry uri https://registry.npmjs.org/shopify-ftp 17 verbose addNameTag registry:https://registry.npmjs.org/shopify-ftp not in flight; fetching 18 verbose request uri https://registry.npmjs.org/shopify-ftp 19 verbose request no auth needed 20 info attempt registry request try #1 at 4:55:56 PM 21 verbose request id 7b256dac3ebed417 22 http request GET https://registry.npmjs.org/shopify-ftp 23 info retry will retry, error on last attempt: Error: unable to verify the first certificate 24 info attempt registry request try #2 at 4:56:08 PM 25 http request GET https://registry.npmjs.org/shopify-ftp 26 info retry will retry, error on last attempt: Error: unable to verify the first certificate 27 info attempt registry request try #3 at 4:57:08 PM 28 http request GET https://registry.npmjs.org/shopify-ftp 29 verbose stack Error: unable to verify the first certificate 29 verbose stack at Error (native) 29 verbose stack at TLSSocket. (_tls_wrap.js:1017:38) 29 verbose stack at emitNone (events.js:67:13) 29 verbose stack at TLSSocket.emit (events.js:166:7) 29 verbose stack at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8) 29 verbose stack at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38) 30 verbose cwd H:
31 error Windows_NT 10.0.10240 32 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "shopify-ftp" 33 error node v4.4.7 34 error npm v2.15.8 35 error code UNABLE_TO_VERIFY_LEAF_SIGNATURE 36 error unable to verify the first certificate 37 error If you need help, you may report this error at: 37 error https://github.com/npm/npm/issues 38 verbose exit [ 1, true ]

InterfixDirect avatar Jul 13 '16 15:07 InterfixDirect

Try running this command before installing shopify-ftp:

npm config set strict-ssl false

Just make sure you set it back to true once shopify-ftp is installed.

Source: http://stackoverflow.com/a/29383238/614747

bxmas13 avatar Jul 13 '16 18:07 bxmas13

Wow, great answer @bxmas13. I would not have known how to answer that (nor do I understand why disabling strict-ssl is necessary to install this module).

Also, I didn't realize people are using this module. I hope it is useful for you. Thanks!

sstur avatar Jul 15 '16 13:07 sstur

Thank you - however, I've tried that and get the following;

Your environment has been set up for using Node.js 4.4.7 (x64) and npm.

H:>npm install -g shopify-ftp npm ERR! Windows_NT 10.0.10240 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "shopify-ftp" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE

npm ERR! unable to verify the first certificate npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! H:\npm-debug.log

H:>

InterfixDirect avatar Jul 15 '16 14:07 InterfixDirect

Right... fixed that last issue! However, still getting this error when trying to connect through Filezilla:

Status: Connecting to 127.0.0.1:2121... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server Status: Waiting to retry... Status: Connecting to 127.0.0.1:2121... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server

InterfixDirect avatar Jul 15 '16 14:07 InterfixDirect

Make sure your username is ###################@your-shopify-site and password is your private API password. The "#####..." is your API key.

Example: http://my-coolsite.myshopify.com Private API Key: 123123123123123123 Private API Pass: 456456456456456456 FTP Host: 127.0.0.1 FTP Port: 2121 FTP username: 123123123123123123@my-coolsite FTP Pass: 456456456456456456

*Note the FTP username doesn't have the .myshopify.com portion.

bxmas13 avatar Jul 15 '16 16:07 bxmas13

Sorry for delay in trying this - had a bit of leave! :)

I'm still getting this error, after following your instructions;

Status: Connecting to 127.0.0.1:2121... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server Status: Waiting to retry... Status: Connecting to 127.0.0.1:2121... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server Status: Disconnected from server Status: Connecting to 127.0.0.1:2121... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server Status: Waiting to retry... Status: Connecting to 127.0.0.1:2121... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server

InterfixDirect avatar Jul 28 '16 10:07 InterfixDirect

Erm... duh... I wasn't using CMD to listen on 127.0.0.1:2121. Did this, now getting this error;

Status: Connecting to 127.0.0.1:2121... Status: Connection established, waiting for welcome message... Status: Insecure server, it does not support FTP over TLS. Command: USER ###########@my-site Response: 331 User name okay, need password. Command: PASS ******************************** Response: 530 Not logged in. Error: Critical error: Could not connect to server

Any help would be greatly appreciated... :)

InterfixDirect avatar Jul 28 '16 11:07 InterfixDirect

I believe that error is from Shopify. My suggestion would be to double check your username and password in Filezilla to make sure everything is correct. In addition, in Shopify Admin, make sure that your API is setup in the Private Apps section.

For a sanity check your Filezilla FTP entry should look similar to this:

Host: 127.0.0.1 Port: 2121 Protocol: FTP - File Transfer Protocol Encryption: Only use plain FTP (insecure) Logon Type: Normal User: fjlk3l23523l5h16lkk13h6l13kh6@my-site <-- Assuming your Shopify URL is my-site.myshopify.com Password: 052f68f88a1b49a02598494f09302e3a <-- That's the API Password

This is what you should see when a proper connection is made:

FTP server listening on 127.0.0.1:2121
FTP connection from 127.0.0.1
fetched themes

bxmas13 avatar Jul 28 '16 16:07 bxmas13