Node Module not found

nodejs

#1

FIXED!
Building without cache solved this problem.

I’m trying to integrate CircleCI to this open source project .
It’s using:-

  • webpack to bundle the js
  • babel to transpile es2015 to es5
  • Mocha + power-assert - unit testing
  • Nightwatch + Mocha - integration testing

When running the unit-test, it will say @cycle/xstream-adapter module not found.
I tried running locally, I even tried it on Travis CI. It works.

So I SSH-ed in and run the node cli on the repo directory to test. require('@cycle/xstream-adapter') and sure enough it cant be found.

I ran npm list | grep @cycle and I see xstream-adapter is a dependency for @cycle/dom so normally it would still work

Next I manually npm install @cycle/xstream-adapter and manually run the npm run unit-test

This time it is able to find the xstream adapter but have other errors. Shown down below.

I am starting to think that there’s something wrong here with how node resolve the modules in CircleCI ?
Anyone experienced anything similar before?

> xstream-boilerplate@0.1.1 unit-test /home/ubuntu/xstream-boilerplate
> cross-env NODE_PATH=./src BABEL_ENV=development mocha -r babel-register

/home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/plugin.js:138
      throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
      ^

Error: Plugin 1 specified in "/home/ubuntu/xstream-boilerplate/.babelrc.env.development" provided an invalid property of "__esModule"
    at Plugin.init (/home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/plugin.js:138:13)
    at Function.normalisePlugin (/home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/file/options/option-manager.js:147:12)
    at /home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/file/options/option-manager.js:181:30
    at Array.map (native)
    at Function.normalisePlugins (/home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/file/options/option-manager.js:153:20)
    at OptionManager.mergeOptions (/home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/file/options/option-manager.js:245:36)
    at OptionManager.init (/home/ubuntu/xstream-boilerplate/node_modules/babel-core/lib/transformation/file/options/option-manager.js:360:12)
    at compile (/home/ubuntu/xstream-boilerplate/node_modules/babel-register/lib/node.js:103:45)
    at loader (/home/ubuntu/xstream-boilerplate/node_modules/babel-register/lib/node.js:148:14)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ubuntu/xstream-boilerplate/node_modules/babel-register/lib/node.js:158:7)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at /home/ubuntu/xstream-boilerplate/node_modules/mocha/lib/mocha.js:220:27
    at Array.forEach (native)
    at Mocha.loadFiles (/home/ubuntu/xstream-boilerplate/node_modules/mocha/lib/mocha.js:217:14)
    at Mocha.run (/home/ubuntu/xstream-boilerplate/node_modules/mocha/lib/mocha.js:485:10)
    at Object.<anonymous> (/home/ubuntu/xstream-boilerplate/node_modules/mocha/bin/_mocha:405:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3

#2

Hmm after clearing cache and editing my circle.yml it worked.

Now to make selenium driver run in the background…


#3