2017-02-16 4 views
0

git、nvm、node、およびgonesubからangle2リポジトリをインストールするEC2インスタンスを立ち上げるためのterraformスクリプトがあります。 terrformスクリプトがngBuild.logTerraform user_data ng build

Path must be a string. Received undefined 
TypeError: Path must be a string. Received undefined 
at assertPath (path.js:7:11) 
at Object.join (path.js:1211:7) 
at Function.fromProject (/test/node_modules/@angular/cli/models/config.js:53:39) 
at Object.<anonymous> (/test/node_modules/@angular/cli/commands/serve.js:11:35) 
at Module._compile (module.js:571:32) 
at Object.Module._extensions..js (module.js:580:10) 
at Module.load (module.js:488:32) 
at tryModuleLoad (module.js:447:12) 
at Function.Module._load (module.js:439:3) 
at Module.require (module.js:498:17) 
at require (internal/module.js:20:19) 
at Class.includedCommands (/test/node_modules/@angular/cli/addon/index.js:23:16) 
at /test/node_modules/@angular/cli/ember-cli/lib/models/project.js:326:61 
at Array.forEach (native) 
at Project.addonCommands (/test/node_modules/@angular/cli/ember-cli/lib/models/project.js:325:15) 
at Project.eachAddonCommand (/test/node_modules/@angular/cli/ember-cli/lib/models/project.js:360:30) 
at module.exports (/test/node_modules/@angular/cli/ember-cli/lib/cli/lookup-command.js:33:13) 
at CLI.<anonymous> (/test/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:42:26) 
at tryCatch (/fsi-ui/node_modules/rsvp/dist/rsvp.js:538:12) 
at invokeCallback (/test/node_modules/rsvp/dist/rsvp.js:553:13) 
at publish (/test/node_modules/rsvp/dist/rsvp.js:521:7) 
at flush (/test/node_modules/rsvp/dist/rsvp.js:2373:5) 
at _combinedTickCallback (internal/process/next_tick.js:67:7) 
at process._tickCallback (internal/process/next_tick.js:98:9) 

私はEC2インスタンスにSSH、および同じng buildコマンドを実行した場合、それが正常に動作奇妙なことに、このエラーを返します何らかの理由で

# install angular cli globally 
npm install -g @angular/cli &> globalCli.log 
cd test 
# install node_modules 
npm install &> npmInstall.log 
# create dist folder 
ng build --output-path 'dist' >& ngBuild.log 
ng update >& ngUpdate.log 
#start the app 
(npm start) &> npmStart.log``` 

アイデア?

答えて

0

誰かがこの問題に遭遇した場合(私は検索して回答を見つけて検索し、問題を解決したものを見つけることができませんでした)。

最終的に、それは@ angular/cliのバージョン問題になった。手動でec2インスタンス内でng buildを実行したとき、私はグローバルなcliとローカルのcliの間に違いがあることを知ることができました。 package.jsonを更新してlatestを使用し、次にangular-cli.jsonファイル"environmentSource": "environments/environment.ts"に次を追加する必要がありました。

私が出力したログには、パスには文字列が必要だと言われていますが、私はterraformで発生しているスクリプトの問題だと思います。 /dist/が正常にインストールされます!

関連する問題