0
我有一個terraform腳本來站起來一個EC2實例,它安裝git,nvm,node,並從github安裝一個angular2倉庫。Terraform user_data 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```
出於某種原因,terrform腳本返回該錯誤ngBuild.log
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)
奇怪的是,如果我ssh到EC2實例,並運行相同的ng build
命令,它工作正常。
任何想法?