Skip to content

Can't install addon from remote #1436

@Krzema

Description

@Krzema

Please paste the output of ember -v here

ember-cli: 3.26.1
node: 12.22.0
os: win32 x64

Please paste the output of tsc -v here

Version 4.3.3

Please paste the version of ember-cli-typescript and ember-cli-typescript-blueprints here

ember-cli-typescript@4.2.1
ember-cli-typescript-blueprints@3.0.0

Please paste your tsconfig.json and tslint.json or eslint.json (if applicable) below

My tsconfig.json

{
"compilerOptions": {
"target": "es2020",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"alwaysStrict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noEmitOnError": true,
"noEmit": true,
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": ".",
"module": "es6",
"experimentalDecorators": true,
"paths": {
"test-app/tests/": [
"tests/
"
],
"test-app/": [
"app/
"
],
"": [
"types/
"
]
}
},
"include": [
"app//*",
"tests/
/",
"types/**/
"
]
}

What are instructions we can follow to reproduce the issue?

ember new test-app; cd ./test-app # Create a new ember app
ember install ember-cli-typescript # Set up typescript support

npm install --save-dev https://github.com/Krzema/test-addon 

Now about that bug. What did you expect to see?

I expected to add my remote github addon (test-addon) to application. This addon is simple addon generated by ember-cli:

ember addon test-addon
ember install ember-cli-typescript

and pushed to GitHub

What happened instead?

I get an error below:

D:\Projekty\test-addons\test-app>npm install --save-dev https://github.com/Krzema/test-addon 

> test-addon@0.0.0 prepack C:\Users\lkrzeminski\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-311fb67e
> ember ts:precompile

The specified command ts:precompile is invalid. For available options, see `ember help`.

npm ERR! premature close

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lkrzeminski\AppData\Roaming\npm-cache\_logs\2021-06-18T08_44_30_743Z-debug.log

debug.log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\lkrzeminski\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '--save-dev',
1 verbose cli   'https://github.com/Krzema/test-addon'
1 verbose cli ]
2 info using npm@6.14.11
3 info using node@v12.22.0
4 verbose npm-session 5a9d54e2b2510515
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 info lifecycle test-addon@0.0.0~prepack: test-addon@0.0.0
8 verbose lifecycle test-addon@0.0.0~prepack: unsafe-perm in lifecycle true
9 verbose lifecycle test-addon@0.0.0~prepack: PATH: C:\Users\lkrzeminski\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\lkrzeminski\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-311fb67e\node_modules\.bin;D:\app\lkrzeminski\product\12.1.0\client_1;D:\app\lkrzeminski\product\12.1.0\client_1\bin;C:\Program Files (x86)\Java\jdk1.8.0_201\bin;C:\Program Files\Microsoft MPI\Bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual SourceSafe;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs\;C:\Program Files (x86)\dotnet\;C:\Users\lkrzeminski\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\lkrzeminski\AppData\Local\Programs\Python\Python39\;C:\Users\lkrzeminski\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.4\bin;C:\Users\lkrzeminski\AppData\Local\Atlassian\SourceTree\git_local\cmd;C:\Users\lkrzeminski\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\lkrzeminski\.dotnet\tools;C:\Users\lkrzeminski\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual SourceSafe;c:\Windows\System32\inetsrv;C:\Users\lkrzeminski\AppData\Roaming\npm
10 verbose lifecycle test-addon@0.0.0~prepack: CWD: C:\Users\lkrzeminski\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-311fb67e
11 silly lifecycle test-addon@0.0.0~prepack: Args: [ '/d /s /c', 'ember ts:precompile' ]
12 silly lifecycle test-addon@0.0.0~prepack: Returned: code: 1  signal: null
13 info lifecycle test-addon@0.0.0~prepack: Failed to exec prepack script
14 silly fetchPackageMetaData error for git+https://github.com/Krzema/test-addon.git premature close
15 timing stage:rollbackFailedOptional Completed in 1ms
16 timing stage:runTopLevelLifecycles Completed in 9400ms
17 verbose stack Error: premature close
17 verbose stack     at PassThrough.onclose (C:\Users\lkrzeminski\AppData\Roaming\npm\node_modules\npm\node_modules\end-of-stream\index.js:47:67)
17 verbose stack     at PassThrough.emit (events.js:326:22)
17 verbose stack     at emitCloseNT (internal/streams/destroy.js:69:8)
17 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:83:21)
18 verbose cwd D:\Projekty\test-addons\test-app
19 verbose Windows_NT 10.0.19041
20 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lkrzeminski\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "https://github.com/Krzema/test-addon"
21 verbose node v12.22.0
22 verbose npm  v6.14.11
23 error premature close
24 verbose exit [ 1, true ]

It looks like it can't execute command ember ts:precompile. I assume, that npm first clone repo from github, then fire this prepack script. It is done before npm install is executed in addon, so there is no ember-cli-typescript in node_modules, so he didn't recognize ember ts:precompile command. Am I right?
Everything is working fine if I install this addon locally by: npm install -save-dev D:\Projects\test-addon and run ember ts:precompile manually in my addon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions