Closed 9710willy closed 4 years ago
This is also affects builds on aws/codebuild/standard:4.0 image, without whitespace in the path:
> @aws-amplify/cli@4.31.0 postinstall /usr/local/lib/node_modules/@aws-amplify/cli
178 | > node scripts/post-install.js
179 |
180 | /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/index.js:205
181 | throw error;
182 | ^
183 |
184 | Error: Command failed with exit code 1: /usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify post-install
185 | Scanning for plugins...
186 | Plugin scan failed.
187 | Plugin scan failed.
188 | Error: Plugin scan failed.
189 | at scan (/usr/local/lib/node_modules/@aws-amplify/cli/lib/plugin-manager.js:141:15)
190 | at makeError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/lib/error.js:59:11)
191 | at Function.module.exports.sync (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/index.js:188:17)
192 | at Function.module.exports.commandSync (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/index.js:227:15)
193 | at Object.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/scripts/post-install.js:23:9)
194 | at Module._compile (internal/modules/cjs/loader.js:1138:30)
195 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
196 | at Module.load (internal/modules/cjs/loader.js:986:32)
197 | at Function.Module._load (internal/modules/cjs/loader.js:879:14)
198 | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
199 | at internal/main/run_main_module.js:17:47 {
200 | shortMessage: 'Command failed with exit code 1: /usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify post-install',
201 | command: '/usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify post-install',
202 | exitCode: 1,
203 | signal: undefined,
204 | signalDescription: undefined,
205 | stdout: 'Scanning for plugins...\n' +
206 | 'Plugin scan failed.\n' +
207 | 'Plugin scan failed.\n' +
208 | 'Error: Plugin scan failed.\n' +
209 | ' at scan (/usr/local/lib/node_modules/@aws-amplify/cli/lib/plugin-manager.js:141:15)',
210 | stderr: '',
211 | failed: true,
212 | timedOut: false,
213 | isCanceled: false,
214 | killed: false
215 | }
216
Hi @9710willy thanks for reporting this, we're investigating now. In the meantime, the CLI should actually still be usable even though the installation failed. The only features affected by the post-install script are local mocking. Hope this unblocks you for now.
Also failing on Debian:
@aws-amplify/cli@4.31.0 postinstall /usr/local/lib/node_modules/@aws-amplify/cli node scripts/post-install.js
/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/index.js:205 throw error; ^
Error: Command failed with exit code 1: /usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify post-install
┌───────────────────────────────────────────────────┐
│ @aws-amplify/cli update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /root/.config │
└───────────────────────────────────────────────────┘
Scanning for plugins...
Plugin scan failed.
Plugin scan failed.
Error: Plugin scan failed.
at scan (/usr/local/lib/node_modules/@aws-amplify/cli/lib/plugin-manager.js:141:15)
at makeError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/lib/error.js:59:11)
at Function.module.exports.sync (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/index.js:188:17)
at Function.module.exports.commandSync (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/execa/index.js:227:15)
at Object.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @aws-amplify/cli@4.31.0 postinstall: node scripts/post-install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @aws-amplify/cli@4.31.0 postinstall script.
@mattk- @TonyAsbestosAlert after the installation fails, are you able to run amplify plugin scan
? Or do you get the same error?
Also @mattk- @TonyAsbestosAlert did you install the cli using sudo?
@TonyAsbestosAlert Got it. We've reverted the change and if you re-run npm install -g @aws-amplify/cli
- the CLI should install correctly.
This issue has been fixed in CLI version 4.31.1. If you installed version 4.31.0 using sudo, you may need to sudo remove the .amplify/lib folder before installing the latest version:
sudo rm -rf ~/.amplify/lib
Thanks Edward, successfully installed on Debian.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels for those types of questions.
Describe the bug If you attempt to upgrade aws-amplify to version 4.31.0 with a path that contains whitespace, it will fail; then amplify-cli will not be usable. I had no problems upgrading up until now! Thanks for all your hard work 👍
Amplify CLI Version 4.30.0
To Reproduce run npm i -g @aws-amplify/cli
Expected behavior Successful upgrade to 4.30.0 -> 4.31.0
Screenshots
Desktop (please complete the following information):
Additional context Add any other context about the problem here.