5

I am trying to set up the basic aurelia app on windows. I have followed instructions from: http://aurelia.io/get-started.html, which includes:

  1. Installed node js
  2. Installed the gulp using: npm install -g gulp
  3. Installed jspn by using: npm install -g jspm
  4. Then downloaded the sample source code from https://github.com/aurelia/skeleton-navigation/releases to the project folder.
  5. Opened a console and changed to project directory ie. navigation-app
  6. Executed the command : npm install
  7. Executed the command: jspm install -y
  8. Finally launched the server using command: gulp watch

All above steps are completed successfully except step 8, which is giving an error :

E:\aurelia\navigation-app>gulp watch
module.js:338
    throw err;
          ^
Error: Cannot find module 'debug/node'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (E:\aurelia\navigation-app\node_modules\gulp-babel\nod
e_modules\babel-core\lib\babel\util.js:22:34)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

I am not getting why it can not find modules. If I install that module manually it gives error message for another module when I try to run : gulp watch

vish
  • 155
  • 2
  • 12
  • When you run `node -v`, `npm -v`, `jspm -v`, and `gulp -v` what is returned? – Ashley Grant Apr 04 '15 at 14:51
  • E:\aurelia\navigation-app>`node -v` v0.12.2 E:\aurelia\navigation-app>`npm -v` 2.7.4 E:\aurelia\navigation-app>`jspm -v` 0.15.1 Running against global jspm install. E:\aurelia\navigation-app>`gulp -v` [23:26:05] CLI version 3.8.11 [23:26:05] Local version 3.8.11 – vish Apr 04 '15 at 17:57
  • I'm on node v0.10.35 without issue. Have you tried reverting to a previous version of node? – PW Kad Apr 05 '15 at 15:56
  • 1
    You may be having problem downloading from git. See this comment from the Aurealia install page. "but GitHub has a rate limit on anonymous API requests. It is advised that you configure jspm with your GitHub credentials in order to avoid problems. You can do this by executing jspm registry config github and following the prompts." – Chi Row Apr 05 '15 at 20:13
  • I had a similar (although not identical) problem. My issue lied in the jspm cache. Try clearing it and see if that solves it: `jspm cc` – aleith Jun 23 '15 at 03:09

4 Answers4

4

I have also been battling this problem since upgrading Aurelia and related tools to the latest versions. It may be related to path length/depth issues on Windows with the native Module.require.

When I uninstalled the following packages from the project's local node_modules folder and instead installed them in the global NPM cache (which lives at a more shallow directory depth in my case), gulp build started working again:

npm uninstall gulp-babel
npm uninstall browser-sync
npm uninstall karma

npm install -g gulp-babel
npm install -g browser-sync
npm install -g karma
Craigology
  • 161
  • 3
  • Thanks @Craigology, I will try the same – vish May 07 '15 at 09:10
  • 1
    Uninstalling and installing `gulp-babel` again like this (globally) worked for me when [agar.io-clone](https://github.com/huytd/agar.io-clone)'s postinstall process gave me `Error: Cannot find module './lib/babel/api/node.js'`. So thanks, +1! – Sk8erPeter Jul 01 '15 at 19:41
1

I had the exact same error, and since debug/node is not actually a package, I was very confused for days. But this is the solution that worked for me. Pretty dumb and easy, but I'm re-posting here hoping that it will save someone else's days..

In short, the solution is to remove the node_modules folder inside the application and running npm install again.

Community
  • 1
  • 1
jeff
  • 11,519
  • 28
  • 67
  • 126
0

Likely the problem is that you're not running NPM v3...

You might find these installation instructions useful if you're having trouble getting Aurelia installed and running on Windows.

(Additional details can be found at http://www.alexdresko.com/2015/11/24/getting-started-with-aurelia-on-windows-10/)

  1. install chocolatey
  2. choco install git -y
  3. Configure git
  4. choco install python2 -y
  5. create python environment variable
  6. echo %python% to make sure the environment variable is created and working.
  7. npm install -g gulp
  8. npm install -g jspm
  9. mkdir c:\code\aureliatest (or some test directory)
  10. cd c:\code\aureliatest
  11. npm install -g yo generator-aurelia
  12. install visual studio community (CORRECLTY) https://www.visualstudio.com/en- us/downloads/post-install-vs?campaign=ct!!223A5085247E47A1A9F37AA43E69C2A5
  13. choco install googlechrome -y
  14. yo aurelia
  15. gulp watch
Alex Dresko
  • 4,817
  • 2
  • 35
  • 54
0

I had the same issue. Gulp watch resulted in "missing socket.io". Apparently browser-sync, that has socket.io as a dependency, didn't install completely/properly. If you run npm install in root of your project it wont check for dependencies of your dependencies. You have to run npm install in the folder of the module with the missing dependencies. Chances are you will do this for a few times(I sure did)

Gilbert Nwaiwu
  • 829
  • 1
  • 12
  • 29