Update installation instructions in README
Hey!
I cannot install dadi/cdn following the readme "Your first CDN project" instructions.
This is what I did:
mkdir my-dadi
cd my-dadi
npm install --save @dadi/cdn
echo "const app = require('@dadi/cdn')" >> index.js
node index.js
Resulting in this error:
Error: ENOENT: no such file or directory, open './config/config.development.json' at Object.fs.openSync (fs.js:646:18) at Object.fs.readFileSync (fs.js:551:33) at loadFile (/Users/clement/node_modules/convict/lib/convict.js:452:19) at /Users/clement/node_modules/convict/lib/convict.js:611:24 at Array.forEach (
) at Config.loadFile (/Users/clement/node_modules/convict/lib/convict.js:609:13) at new Config (/Users/clement/node_modules/@dadi/cdn/config.js:678:8) at Object. (/Users/clement/node_modules/@dadi/cdn/config.js:859:18)
I feel like a default config file should have been created at some point. Later, the README says "When CDN was installed, a development configuration file was created for you in a config folder at your application root." What does "When CDN was installed" mean? Did I miss a step?
Here is the npm install log:
npm WARN saveError ENOENT: no such file or directory, open '/Users/clement/package.json' npm WARN enoent ENOENT: no such file or directory, open '/Users/clement/package.json' npm WARN [email protected] requires a peer of sharp@^0.20.0 but none was installed. npm WARN clement No description npm WARN clement No repository field. npm WARN clement No README data npm WARN clement No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/google-closure-compiler-linux): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"x64,x86"} (current: {"os":"darwin","arch":"x64"})
- @dadi/[email protected] added 2 packages, removed 1 package and updated 1 package in 24.219s
node v8.12.0 npm v5.1.0 macOS 10.11.6
Thanks
@iwazaru it looks like you haven't created a config. If you continue through the readme to the Configuration section you'll find instructions and a link to the docs site.
The recommended method for installing CDN is through the DADI CLI, which takes you through an interactive setup process for creating a configuration file. You can read more about it here.
Thanks, I'll have a look at the CLI.
May I suggest that the "Your first CDN project" instructions in the README file should point to the CLI if this is the recommended method or that the "Configuration" step should come before the "Start server" step with clear instructions on how to create a default config file?
Definitely. We've been using our docs site as the main point for documentation (see https://docs.dadi.cloud/cdn/3.4#installation), where we do indicate CLI as the preferred method for installation.
We also will update the README accordingly, for people that reach us through the GitHub repository. Thanks for flagging this!