angular-seed icon indicating copy to clipboard operation
angular-seed copied to clipboard

⨯ Unable to compile TypeScript

Open ghost opened this issue 11 years ago • 56 comments

/var/www/html/ng2-lab/angular2-seed$ npm run serve.dev

[email protected] serve.dev /var/www/html/ng2-lab/angular2-seed gulp serve.dev

[11:57:53] Requiring external module ts-node/register

⨯ Unable to compile TypeScript

I am getting this error, with angular alpha 0.40

ghost avatar Oct 13 '15 06:10 ghost

Looks like this issue https://github.com/mgechev/angular2-seed/issues/132.

We'll have a look.

mgechev avatar Oct 13 '15 06:10 mgechev

@mgechev , I fixed it by compiling the .ts files to .js

tsc tools/tasks/*.ts gulpfile.ts

Now it works

ghost avatar Oct 13 '15 06:10 ghost

@ravi-tj yeah, this works, however, it is more than a workaround rather than a real solution.

There's an issue with the ts-node module, which doesn't run the build gulpfile itself.

mgechev avatar Oct 13 '15 07:10 mgechev

FYI: npm WARN deprecated [email protected]: typescript-node has been renamed to ts-node Maybe we don't need that one.

ludohenin avatar Oct 15 '15 05:10 ludohenin

This issue is fixed by https://github.com/mgechev/angular2-seed/pull/155

mgechev avatar Oct 15 '15 14:10 mgechev

Hi @mgechev I cloned the repo, executed npm install and still have this problem. What should I do to resolve it?

ghost avatar Oct 30 '15 19:10 ghost

@tommyJS could you tell what error you get?

tarlepp avatar Oct 30 '15 20:10 tarlepp

npm start

> [email protected] start /home/tommyjs/Desktop/angular2-hot-loader
> gulp serve --env dev

[19:54:56] Requiring external module ts-node/register
----------------------------------
⨯ Unable to compile TypeScript

gulpfile.ts (1,23): Cannot find module 'gulp'. (2307)
----------------------------------

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `gulp serve --env dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'gulp serve --env dev'.
npm ERR! This is most likely a problem with the angular2-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp serve --env dev
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular2-seed
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tommyjs/Desktop/angular2-hot-loader/npm-debug.log
tommyjs-VPCEB2S1E angular2-hot-loader # npm start

> [email protected] start /home/tommyjs/Desktop/angular2-hot-loader
> gulp serve --env dev

[20:17:28] Requiring external module ts-node/register
----------------------------------
⨯ Unable to compile TypeScript

gulpfile.ts (1,23): Cannot find module 'gulp'. (2307)
----------------------------------

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `gulp serve --env dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'gulp serve --env dev'.
npm ERR! This is most likely a problem with the angular2-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp serve --env dev
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular2-seed
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tommyjs/Desktop/angular2-hot-loader/npm-debug.log

In advance, thank you for your help.

ghost avatar Oct 30 '15 20:10 ghost

and npm install didn't give any errors?

tarlepp avatar Oct 30 '15 20:10 tarlepp

I don't see any errors.

However, the info from npm install is so long that I cannot analyze it from the beginning. Do you know how to log this output to a file?

ghost avatar Oct 31 '15 14:10 ghost

Npm install > log.txt Something like that?

On 31 Oct 2015, at 15:25, Tomasz Adrianowski [email protected] wrote:

I don't see any errors.

However, the info from npm install is so long that I cannot analyze it from the beginning. Do you know how to log this output to a file?

— Reply to this email directly or view it on GitHub.

Sn3b avatar Oct 31 '15 14:10 Sn3b

Thank you. There are no errors during npm install. Unfortunately, I cannot upload here .txt files.

Do you have other ideas?

ghost avatar Oct 31 '15 15:10 ghost

I am getting this issues too. after a successful npm install. I have compiled typescript before for another project so not sure why its not working on this one. I'm using Ubuntu 15, Node v5.2.0 and Npm v3.5.2

> [email protected] start /home/al/Projects/Video Dash/seed-test/angular2-seed
> gulp serve --env dev

[08:16:34] Requiring external module ts-node/register
----------------------------------
⨯ Unable to compile TypeScript

gulpfile.ts (1,23): Cannot find module 'gulp'. (2307)
tools/config.ts (1,28): Cannot find module 'fs'. (2307)
tools/config.ts (58,25): Cannot find name 'require'. (2304)
tools/typings/merge-stream.d.ts (2,36): Cannot find namespace 'NodeJS'. (2503)
tools/typings/merge-stream.d.ts (3,33): Cannot find namespace 'NodeJS'. (2503)
tools/typings/merge-stream.d.ts (4,17): Cannot find namespace 'NodeJS'. (2503)
tools/typings/systemjs-builder.d.ts (4,60): Cannot find name 'Promise'. (2304)
tools/typings/systemjs-builder.d.ts (5,65): Cannot find name 'Promise'. (2304)
tools/utils.ts (9,17): Cannot find name 'require'. (2304)
tools/utils/server.ts (2,26): Cannot find module 'express'. (2307)
tools/utils/server.ts (5,30): Cannot find module 'serve-static'. (2307)
tools/utils/server.ts (6,23): Cannot find module 'path'. (2307)
tools/utils/server.ts (19,20): Cannot find name 'process'. (2304)
tools/utils/server.ts (39,25): Cannot find name 'process'. (2304)
tools/utils/tasks_tools.ts (1,23): Cannot find module 'gulp'. (2307)
tools/utils/tasks_tools.ts (2,23): Cannot find module 'gulp-util'. (2307)
tools/utils/tasks_tools.ts (3,24): Cannot find module 'chalk'. (2307)
tools/utils/tasks_tools.ts (5,50): Cannot find module 'fs'. (2307)
tools/utils/tasks_tools.ts (6,20): Cannot find module 'path'. (2307)
tools/utils/tasks_tools.ts (17,10): Cannot find name 'require'. (2304)
tools/utils/template-injectables.ts (2,20): Cannot find module 'path'. (2307)

stagfoo avatar Dec 16 '15 22:12 stagfoo

It can happen that after the npm install and you're getting this kind of error that you have to manually run npm run tsd -- install. This does not happen all the time for me but sometimes only.

ludohenin avatar Dec 17 '15 08:12 ludohenin

Not sure why it's closed, it's still an issue. If there are global dependencies - please list them.

e-oz avatar Jan 24 '16 17:01 e-oz

Same here at a developer of my team

gustavolira avatar Feb 08 '16 14:02 gustavolira

@gustavolira do you have ts-node installed globally?

mgechev avatar Feb 08 '16 14:02 mgechev

Yes I have, now is occurring with another developers. If I do npm start ou npm run build.dev I receive:

⨯ Unable to compile TypeScript

gulpfile.ts (1,23): Cannot find module 'gulp'. (2307) tools/config.ts (1,28): Cannot find module 'fs'. (2307) tools/config.ts (2,20): Cannot find module 'yargs'. (2307) tools/config.ts (3,31): Cannot find module 'path'. (2307) tools/config.ts (14,52): Cannot find name '__dirname'. (2304) tools/config.ts (165,50): Cannot find name 'require'. (2304) tools/manual_typings/merge-stream.d.ts (2,36): Cannot find namespace 'NodeJS'. (2503) tools/manual_typings/merge-stream.d.ts (3,33): Cannot find namespace 'NodeJS'. (2503) tools/manual_typings/merge-stream.d.ts (4,17): Cannot find namespace 'NodeJS'. (2503) tools/utils.ts (9,17): Cannot find name 'require'. (2304) tools/utils/code_change_tools.ts (2,20): Cannot find module 'path'. (2307) tools/utils/code_change_tools.ts (4,30): Cannot find module 'browser-sync'. (2307) tools/utils/server.ts (1,26): Cannot find module 'express'. (2307) tools/utils/server.ts (3,30): Cannot find module 'serve-static'. (2307) tools/utils/server.ts (5,23): Cannot find module 'path'. (2307) tools/utils/server.ts (22,25): Cannot find name 'process'. (2304) tools/utils/tasks_tools.ts (1,23): Cannot find module 'gulp'. (2307) tools/utils/tasks_tools.ts (2,23): Cannot find module 'gulp-util'. (2307) tools/utils/tasks_tools.ts (3,24): Cannot find module 'chalk'. (2307) tools/utils/tasks_tools.ts (4,34): Cannot find module 'gulp-load-plugins'. (2307) tools/utils/tasks_tools.ts (5,31): Cannot find module 'run-sequence'. (2307) tools/utils/tasks_tools.ts (6,50): Cannot find module 'fs'. (2307) tools/utils/tasks_tools.ts (7,20): Cannot find module 'path'. (2307) tools/utils/tasks_tools.ts (19,10): Cannot find name 'require'. (2304) tools/utils/template_injectables.ts (4,20): Cannot find module 'path'. (2307)

gustavolira avatar Feb 08 '16 19:02 gustavolira

  1. npm install -g ts-node should be without sudo.
  2. All type definitions (for gulp, fs, run-sequence, path, etc) should be installed in typings.

mgechev avatar Feb 08 '16 19:02 mgechev

I'm running at a dev server there's only root user npm install -g ts-node was installed with root user. My typings.json is:

root@ubuntu-4gb-nyc3-01:~/angular2-seed# cat typings.json { "dependencies": { "es6-promise": "github:typings/typed-es6-promise#9243c53f70fb4909ed7cce3094bec221b9fb6d5f", "xhr2": "github:gdi2290/typed-xhr2#69f2b8d40d0cd407c1b2a2f2f41fecc6852cabbb" }, "devDependencies": {}, "ambientDependencies": { "Q": "github:DefinitelyTyped/DefinitelyTyped/q/Q.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#64b25f63f0ec821040a5d3e049a976865062ed9d", "async": "github:DefinitelyTyped/DefinitelyTyped/async/async.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "browserify": "github:DefinitelyTyped/DefinitelyTyped/browserify/browserify.d.ts#138ad74b9e8e6c08af7633964962835add4c91e2", "browser-sync": "github:DefinitelyTyped/DefinitelyTyped/browser-sync/browser-sync.d.ts#d9b5b35ba3a79ac778c5890531393442439df5dd", "chalk": "github:DefinitelyTyped/DefinitelyTyped/chalk/chalk.d.ts#5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff", "chokidar": "github:DefinitelyTyped/DefinitelyTyped/chokidar/chokidar.d.ts#ae81e340a9e897167cfef3122a5a3aed04293814", "del": "github:DefinitelyTyped/DefinitelyTyped/del/del.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2", "express": "github:DefinitelyTyped/DefinitelyTyped/express/express.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "glob": "github:DefinitelyTyped/DefinitelyTyped/glob/glob.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "gulp": "github:DefinitelyTyped/DefinitelyTyped/gulp/gulp.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "gulp-load-plugins": "github:DefinitelyTyped/DefinitelyTyped/gulp-load-plugins/gulp-load-plugins.d.ts#e081148d88b857d66509e3b46edbd08b3f75f96a", "gulp-shell": "github:DefinitelyTyped/DefinitelyTyped/gulp-shell/gulp-shell.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "gulp-util": "github:DefinitelyTyped/DefinitelyTyped/gulp-util/gulp-util.d.ts#5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff", "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#26c98c8a9530c44f8c801ccc3b2057e2101187ee", "mime": "github:DefinitelyTyped/DefinitelyTyped/mime/mime.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "minimatch": "github:DefinitelyTyped/DefinitelyTyped/minimatch/minimatch.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "micromatch": "github:DefinitelyTyped/DefinitelyTyped/micromatch/micromatch.d.ts#7cda84786520fd0673c934fde1aa722083e05f7b", "ng2": "github:gdi2290/typings-ng2/ng2.d.ts#32998ff5584c0eab0cd9dc7704abb1c5c450701c", "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#138ad74b9e8e6c08af7633964962835add4c91e2", "orchestrator": "github:DefinitelyTyped/DefinitelyTyped/orchestrator/orchestrator.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "parse-glob": "github:DefinitelyTyped/DefinitelyTyped/parse-glob/parse-glob.d.ts#1ae2ddf27c6e9b98ad7e7fa496788f1aadf37933", "run-sequence": "github:DefinitelyTyped/DefinitelyTyped/run-sequence/run-sequence.d.ts#052725d74978d6b8d7c4ff537b5a3b21ee755a49", "selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea", "serve-static": "github:DefinitelyTyped/DefinitelyTyped/serve-static/serve-static.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "systemjs": "github:DefinitelyTyped/DefinitelyTyped/systemjs/systemjs.d.ts#5c3e47967affa3c4128a3875d1664ba206ae1b0f", "through2": "github:DefinitelyTyped/DefinitelyTyped/through2/through2.d.ts#5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff", "vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff", "vinyl-source-stream": "github:DefinitelyTyped/DefinitelyTyped/vinyl-source-stream/vinyl-source-stream.d.ts#ffceea9dd124d277c4597c7bd12930666ec074c5", "yargs": "github:DefinitelyTyped/DefinitelyTyped/yargs/yargs.d.ts#6a287502dab374e7d4cbf18ea1ac5dff7f74726a", "zone.js": "github:DefinitelyTyped/DefinitelyTyped/zone.js/zone.js.d.ts#b923a5aaf013ac84c566f27ba6b5843211981c7a" } }

Any something that I'm missing?

gustavolira avatar Feb 08 '16 19:02 gustavolira