0

I don't have too much experience in NodeJs. I wanted to try Cyclejs. The documentation says:

Create a new directory and run this inside that directory:

npm install rx @cycle/core @cycle/dom

When I do this, I get the following warning:

➜  cycle-examples  npm install rx @cycle/core @cycle/dom
/Users/mertnuhoglu/projects/js/tmp2/cycle-examples
├── @cycle/core@5.0.1
├─┬ @cycle/dom@7.1.1
│ ├─┬ es6-map@0.1.1
│ │ ├── d@0.1.1
│ │ ├─┬ es5-ext@0.10.8
│ │ │ ├── es6-iterator@2.0.0
│ │ │ └── es6-symbol@3.0.1
│ │ ├─┬ es6-iterator@0.1.3
│ │ │ └── es6-symbol@2.0.1
│ │ ├─┬ es6-set@0.1.2
│ │ │ ├── es6-iterator@2.0.0
│ │ │ └── es6-symbol@3.0.1
│ │ ├── es6-symbol@0.1.1
│ │ └── event-emitter@0.3.4
│ ├── matches-selector@1.0.0
│ ├── vdom-parser@1.2.1
│ ├─┬ vdom-to-html@2.1.1
│ │ ├── escape-html@1.0.3
│ │ ├─┬ param-case@1.1.1
│ │ │ └─┬ sentence-case@1.1.2
│ │ │   └── lower-case@1.1.2
│ │ └── xtend@4.0.0
│ ├─┬ virtual-dom@2.1.1
│ │ ├── browser-split@0.0.1
│ │ ├─┬ error@4.4.0
│ │ │ ├── camelize@1.0.0
│ │ │ └── string-template@0.2.1
│ │ ├─┬ ev-store@7.0.0
│ │ │ └── individual@3.0.0
│ │ ├─┬ global@4.3.0
│ │ │ ├─┬ min-document@2.17.0
│ │ │ │ └── dom-walk@0.1.1
│ │ │ └── process@0.5.2
│ │ ├── is-object@1.0.1
│ │ ├── next-tick@0.2.2
│ │ └── x-is-string@0.1.0
│ └── x-is-array@0.1.0
└── rx@4.0.6

npm WARN ENOENT ENOENT, open '/Users/mertnuhoglu/projects/js/tmp2/cycle-examples/package.json'
npm WARN EPACKAGEJSON cycle-examples No description
npm WARN EPACKAGEJSON cycle-examples No repository field.
npm WARN EPACKAGEJSON cycle-examples No README data
npm WARN EPACKAGEJSON cycle-examples No license field.

After that I cloned cycle-examples and run npm start following the instructions. I get the following error:

➜  cycle-examples  git clone https://github.com/cyclejs/cycle-examples
Cloning into 'cycle-examples'...
remote: Counting objects: 184, done.
remote: Total 184 (delta 0), reused 0 (delta 0), pack-reused 184
Receiving objects: 100% (184/184), 31.08 KiB | 0 bytes/s, done.
Resolving deltas: 100% (72/72), done.
Checking connectivity... done.
➜  cycle-examples  npm start
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.7
npm ERR! npm  v3.3.8
npm ERR! path /Users/mertnuhoglu/projects/js/tmp2/cycle-examples/package.json
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/Users/mertnuhoglu/projects/js/tmp2/cycle-examples/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mertnuhoglu/projects/js/tmp2/cycle-examples/npm-debug.log

The error says I need to have package.json. The git repository does not have it. Should I create it on my own? If so, what should I put inside that file?

npm version is 3.3.8

I have browserify@11.2.0 and babel@5.8.23 libraries installed globally in Node.

Community
  • 1
  • 1
Mert Nuhoglu
  • 9,695
  • 16
  • 79
  • 117
  • Can you try changing directory to `cycle-examples` by typing `cd cycle-examples` before running `npm start`? `git clone` creates a new directory called `cycle-examples` inside your existing directory which is also called `cycle-examples` – nilgun Oct 23 '15 at 06:36
  • 1
    I just look at the github repo for the `cycle-examples` and saw that you should also navigate to an example folder before running `npm start`. There is a `package.json` in each of the example folders. So you should do `cd cycle-examples/hello-world` and then run `npm start`. – nilgun Oct 23 '15 at 06:49
  • Thanks Nilgün, this solved the problem actually. – Mert Nuhoglu Oct 23 '15 at 07:00
  • In general, `npm init` will interactively initialize a `package.json` for you. The idea is that you track external dependencies (libraries you use) in that file, specify a version, name and so on, so other people can easily set up your code on their machine. Check out this tutorial: https://www.youtube.com/watch?v=pU9Q6oiQNd0 – kadrian Nov 14 '15 at 14:13

1 Answers1

2

The cycle-examples is a collection of examples. You need to enter an actual example directory, e.g., bmi-nested, and from there issue npm start.

Frederik Krautwald
  • 1,782
  • 23
  • 32