Error: Cannot find module 'stylus'
the-wilhelm opened this issue · 7 comments
Hello I am trying to start a BEM project and project-stub for the first time. I followed all of the directions did an npm install, a bower install, and then it gave me an error about not being able to find the module 'ym'. So I did an npm install ym and then it gave me the connot find module 'stylus' error. I did an npm install stylus, it does it without errors, but when i try to load the project it still gives me that same error. I have no clue where to go from here please help!
@the-wilhelm, just tested it with the following:
git clone git@github.com:bem/project-stub.git
cd project-stub
npm i
./node_modules/.bin/bem server
and opened http://localhost:8080/desktop.bundles/index/index.html in browser — it works fine for me.
so I need some more info about your environment: OS, node version, npm version, log of clean npm install
(which should call bower
automatically as postinstall
).
OS: Mac OS X 10.9.3
Node: v0.10.29
NPM: 1.4.14
Log:
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"})
npm WARN cannot run in wd bem-project-stub@1.0.0 bower-npm-install --non-interactive (wd=/Users/blakewilhelm/Documents/try-again-fool)
bem-environ@1.4.0 node_modules/bem-environ
stylus@0.47.3 node_modules/stylus
├── css-parse@1.7.0
├── mkdirp@0.3.5
├── debug@1.0.4 (ms@0.6.2)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
└── sax@0.5.8
bem-tools-autoprefixer@0.0.3 node_modules/bem-tools-autoprefixer
├── autoprefixer@1.0.20140213 (fs-extra@0.8.1, postcss@0.2.0)
└── q-io@1.10.9 (mimeparse@0.1.4, url2@0.0.0, mime@1.2.11, q@0.9.7, qs@0.1.0, collections@0.2.2)
bower-npm-install@0.5.8 node_modules/bower-npm-install
├── q@0.9.7
├── coa@0.4.1
├── inquirer@0.4.1 (mute-stream@0.0.4, through@2.3.4, async@0.2.10, readline2@0.1.0)
├── byline@3.1.2 (readable-stream@1.1.13-1)
├── lodash@2.4.1
├── cli-color@0.2.3 (memoizee@0.2.6, es5-ext@0.9.2)
├── update-notifier@0.1.10 (chalk@0.4.0, semver@2.3.2, request@2.39.0, configstore@0.3.1)
└── q-io@1.9.4 (mimeparse@0.1.4, url2@0.0.0, mime@1.2.11, collections@0.1.24, qs@0.1.0)
bower@1.3.8 node_modules/bower
├── is-root@0.1.0
├── junk@0.3.0
├── stringify-object@0.2.1
├── abbrev@1.0.5
├── chmodr@0.1.0
├── which@1.0.5
├── opn@0.1.2
├── archy@0.0.2
├── lockfile@0.4.2
├── bower-logger@0.2.2
├── lru-cache@2.5.0
├── bower-endpoint-parser@0.2.2
├── osenv@0.1.0
├── nopt@3.0.1
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── retry@0.6.1
├── rimraf@2.2.8
├── graceful-fs@3.0.2
├── tmp@0.0.23
├── q@1.0.1
├── request-progress@0.3.1 (throttleit@0.0.2)
├── shell-quote@1.4.2 (array-filter@0.0.1, array-reduce@0.0.0, array-map@0.0.0, jsonify@0.0.0)
├── p-throttler@0.0.1 (q@0.9.7)
├── promptly@0.2.0 (read@1.0.5)
├── bower-json@0.4.0 (intersect@0.0.3, deep-extend@0.2.11, graceful-fs@2.0.3)
├── fstream-ignore@0.0.10 (inherits@2.0.1, minimatch@0.3.0)
├── semver@2.3.2
├── mkdirp@0.5.0 (minimist@0.0.8)
├── fstream@0.1.29 (inherits@2.0.1, mkdirp@0.3.5)
├── tar@0.1.20 (inherits@2.0.1, block-stream@0.0.7)
├── bower-config@0.5.2 (osenv@0.0.3, graceful-fs@2.0.3, optimist@0.6.1)
├── glob@4.0.5 (once@1.3.0, inherits@2.0.1, minimatch@1.0.0)
├── decompress-zip@0.0.8 (nopt@2.2.1, mkpath@0.1.0, touch@0.0.2, readable-stream@1.1.13-1, binary@0.3.0)
├── request@2.36.0 (json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, qs@0.6.6, oauth-sign@0.3.0, tunnel-agent@0.4.0, node-uuid@1.4.1, mime@1.2.11, form-data@0.1.4, tough-cookie@0.12.1, http-signature@0.10.0, hawk@1.0.0)
├── bower-registry-client@0.2.1 (request-replay@0.2.0, lru-cache@2.3.1, graceful-fs@2.0.3, async@0.2.10, mkdirp@0.3.5, request@2.27.0)
├── handlebars@1.3.0 (optimist@0.3.7, uglify-js@2.3.6)
├── cardinal@0.4.4 (ansicolors@0.2.1, redeyed@0.4.4)
├── mout@0.9.1
├── insight@0.3.1 (object-assign@0.1.2, async@0.2.10, lodash.debounce@2.4.1, request@2.27.0, inquirer@0.4.1, configstore@0.2.3)
├── update-notifier@0.2.0 (semver-diff@0.1.0, string-length@0.1.2, chalk@0.5.1, latest-version@0.2.0, configstore@0.3.1)
└── inquirer@0.5.1 (readline2@0.1.0, mute-stream@0.0.4, through@2.3.4, async@0.8.0, lodash@2.4.1, cli-color@0.3.2)
bem@0.8.1 node_modules/bem
├── reqf@1.0.0
├── inherit@1.0.4
├── colors@0.6.2
├── cli-table@0.3.0
├── mime@1.2.11
├── mkdirp@0.3.5
├── q@0.9.7
├── apw@0.3.14
├── node.extend@1.0.10 (is@0.3.0)
├── coa@0.4.0
├── benchmark@1.0.0
├── qq@0.3.5 (q@0.8.4)
├── dom-js@0.0.9 (sax@0.6.0)
├── lodash@2.2.1
├── q-io@1.10.9 (mimeparse@0.1.4, url2@0.0.0, qs@0.1.0, collections@0.2.2)
├── winston@0.7.3 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, async@0.2.10, pkginfo@0.3.0, request@2.16.6)
└── borschik@1.0.4 (inherit@2.2.1, vow@0.3.12, minimatch@0.2.14, vow-fs@0.2.3, uglify-js@2.4.13, csso@1.3.11)
It says its installed stylus right there and I see it inside node_modules but when I try to load up the project in my browser it tells me it can not find the module 'stylus'
I followed exactly what you did and now I get an error:
Error: Cannot find module 'bem-xjst/lib/bemhtml'
@the-wilhelm the reason is that bower-npm-install
call was not run:
npm WARN cannot run in wd bem-project-stub@1.0.0 bower-npm-install --non-interactive (wd=/Users/blakewilhelm/Documents/try-again-fool)
I don't know why you get this error. Try to call it manually by ./node_modules/.bin/bower-npm-install
and collect the logs. Also check if you have write permissions for the working directory and so on.
how resolve this trouble
- clone project:
git clone https://github.com/bem/project-stub.git -b bem-core my-bem-project
cd my-bem-project
npm install
- install another libs
npm install stylus -g
npm install bower -g
npm install travis-ci # not necessarily
npm install q-io
- install package for libs
cd libs/bem-components && npm install && bower install
cd ../bem-core && && npm install && bower install
- run server
bem server -p 8080 -v debug
For the first example is too complicated to install!!!
git clone https://github.com/bem/project-stub.git -b bem-core my-bem-project
cd my-bem-project
npm install
should be enough to run bem server
(port 8080
is used by default, there's no need to set it explicitly). You'll get some WARN
messages but you can ignore them.