christophercliff / flatmarket

A free, open source e-commerce platform for static websites.
https://christophercliff.com/flatmarket/
MIT License
1k stars 127 forks source link

Can't install the cli #52

Open radixhound opened 6 years ago

radixhound commented 6 years ago

Tried installing the CLI and failed because my version of node was 6.x. Switched to v4.8.3 via nvm...

➜  flatmarket npm install flatmarket-cli
npm WARN peerDependencies The peer dependency webpack@^2.0.0 || ^3.0.0 included from expose-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN engine crispy-redux@1.2.3: wanted: {"node":"4.2.x"} (current: {"node":"4.8.3","npm":"2.15.11"})
npm WARN deprecated css-list@0.1.3: Deprecated.
\
> fsevents@1.1.3 install /Users/chrisd/flatmarket/node_modules/flatmarket-cli/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
> node install

[fsevents] Success: "/Users/chrisd/flatmarket/node_modules/flatmarket-cli/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/node" "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/npm" "install" "flatmarket-cli"
npm ERR! node v4.8.3
npm ERR! npm  v2.15.11
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package webpack@1.15.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer expose-loader@0.7.4 wants webpack@^2.0.0 || ^3.0.0
npm ERR! peerinvalid Peer extract-text-webpack-plugin@0.8.2 wants webpack@^1.9.11
npm ERR! peerinvalid Peer webpack-dev-server@1.16.5 wants webpack@>=1.3.0 <3

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/chrisd/flatmarket/npm-debug.log

relevant parts of the log which is really long...

82947 info install flatmarket-cli@3.0.1
82948 info postinstall flatmarket-cli@3.0.1
82949 verbose unlock done using /Users/chrisd/.npm/_locks/flatmarket-cli-87700ca9fa0baf5c.lock for /Users/chrisd/flatmarket/node_modules/flatmarket-cli
82950 verbose validateInstall loading /Users/chrisd/flatmarket/package.json for validation
82951 verbose stack Error: The package webpack@1.15.0 does not satisfy its siblings' peerDependencies requirements!
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/lib/install.js:125:32
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/lib/install.js:268:7
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:142:5
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82951 verbose stack     at cb (/Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82951 verbose stack     at cb (/Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82951 verbose stack     at cb (/Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
82951 verbose stack     at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82952 verbose cwd /Users/chrisd/flatmarket
82953 error Darwin 16.7.0
82954 error argv "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/node" "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/npm" "install" "flatmarket-cli"
82955 error node v4.8.3
82956 error npm  v2.15.11
82957 error code EPEERINVALID
82958 error peerinvalid The package webpack@1.15.0 does not satisfy its siblings' peerDependencies requirements!
82958 error peerinvalid Peer expose-loader@0.7.4 wants webpack@^2.0.0 || ^3.0.0
82958 error peerinvalid Peer extract-text-webpack-plugin@0.8.2 wants webpack@^1.9.11
82958 error peerinvalid Peer webpack-dev-server@1.16.5 wants webpack@>=1.3.0 <3
82959 verbose exit [ 1, true ]
victorfeight commented 6 years ago

Confirming the same issue on my end. Seems to be a webpack peer dependency issue. Some plugins older versions, some want newer versions. I'm going to try to get this working by using all the listed dependency versions, but an update by the author would be really helpful.

christophercliff commented 6 years ago

I tested this and couldn't recreate. This runs without errors:

$ node --version && npm --version
v8.9.0
5.5.1
$ mkdir flatmarket-test && cd flatmarket-test
$ npm init --yes
$ npm install --save flatmarket-cli
$ node_modules/.bin/flatmarket --help
victorfeight commented 6 years ago

Thank you for the update. Let me walk you through my setup, so I can show you the error.

When trying to use node v.8.9.0 (npm v.5.5.1) as you recommended, flatmarket-cli installs successfully, however there is an error when trying to build the app's theme via ./node_modules/.bin/flatmarket -c ./node_modules/flatmarket-cli/node_modules/flatmarket-theme-bananas/index.jsx -d pay ./src/flatmarket.json command. It complains " Unknown plugin babel-plugin-transform-react-jsx-source" and refuses to build the theme.

When I switch to node v4.6.2 (npm v.2.15.11), the app refuses to build because of conflicting webpack peerDependency issues. flatmarket-cli expects an older version of webpack, but certain dependencies expect a newer version which causes the build to fail. This is solved by installing the following older dependencies: css-loader-0.18.0.tar.gz style-loader-0.12.3.tar.gz (these two for the development server) expose-loader-0.7.0.tgz webpack-1.11.0.tar.gz (these three for the flatmarket-cli) webpack-dev-server-1.11.0.tar.gz

With these dependencies installed (via npm install --save), then flatmarket-cli installs successfully under node v4.6.2, and the bananas theme successful compiles. However, upon testing the theme in the browser, I noticed that the app.js isn't communicating with Heroku well.

At this point, my payment portal is loaded and I can successfully create a token with the Stripe checkout form. Update: I'll move this issue to the heroku-server page, as recently I tried creating a token with Stripe and processing the charge with flatmarket and flatmarket-server and the test charge processed successfully on the Stripe dashboard, unlike before. This leads me to believe my bug lies in the flatmarket-heroku server.