2017-11-09 4 views
0

nrwl/nxを使用して私はprojectを持っており、自宅のコンピュータ(ウィンドウ)でワークスペース(morningharwood)とアプリケーション(portfolio)を開始しました。移動で、私は今、レポをyarn install depsをクローンし、私のMacで実行しようとしました。 node_modules/.bin/ng serve --app=portfolioを実行している場合残念ながら、私はそのCannot find module 'typescript' from '/Users/m/projects'ローカルでのエラーを取得し、世界的に私はtypescriptですが、インストールがあります。<Path>から 'typescript'モジュールを見つけることができませんが、tsc -v logs

質問:私のプロジェクトはtypescriptですを見つけるカントはなぜ。私のMacでプロジェクトを実行するにはどうすればいいですか?

[email protected]: ~/projects/ on feature/prerender [?] 
$ tsc -v 
Version 2.6.1 

[email protected]: ~/projects/morningharwood/platform on feature/prerender [?] 
$ node_modules/.bin/ng serve --app=portfolio 

Cannot find module 'typescript' from '/Users/m/projects' 
Error: Cannot find module 'typescript' from '/Users/m/projects' 
    at Function.module.exports [as sync] (/Users/m/projects/morningharwood/platform/node_modules/resolve/lib/sync.js:40:15) 
    at Object.requireProjectModule (/Users/m/projects/morningharwood/platform/node_modules/@angular/cli/utilities/require-project-module.js:6:28) 
    at Object.readTsconfig (/Users/m/projects/morningharwood/platform/node_modules/@angular/cli/utilities/read-tsconfig.js:6:48) 
    at new NgCliWebpackConfig (/Users/mharwood/projects/morningharwood/platform/node_modules/@angular/cli/models/webpack-config.js:19:42) 
    at Class.run (/Users/m/projects/morningharwood/platform/node_modules/@angular/cli/tasks/serve.js:71:29) 
    at check_port_1.checkPort.then.port (/Users/m/projects/morningharwood/platform/node_modules/@angular/cli/commands/serve.js:123:26) 
    at <anonymous> 
    at process._tickCallback (internal/process/next_tick.js:188:7) 
[email protected]: ~/projects/morningharwood/platform on feature/prerender [?] 

package.json

"devDependencies": { 
    "ts-node": "^3.3.0", 
    "tsconfig-paths": "^2.3.0", 
    "tslint": "~5.3.2", 
    "typescript": "2.4.2", 
} 
+0

アプリ内のpackage.jsonの場所はどこですか? node_modulesフォルダが作成された場所からng serveを実行する必要があります。 – Niladri

+0

フルパスの代わりに 'ng serve --app = portfolio'を試してみましたか? – Niladri

+0

@Niladriはい同じ問題です。 –

答えて

1

この問題は問題で109 https://github.com/nrwl/nx/issues/109

を解決することがいるここにあなたがそれを修正する方法は次のとおりです。

ので、問題があります.angular-cli.jsonのルートプロパティが0123に設定されている"root": "apps \ portfolio \ src"、 apps/portfolio/srcに変更すると動作します。私はそれを修正します。

nrwlの将来のリリースで修正される予定です。

関連する問題